Showing posts with label combobox. Show all posts
Showing posts with label combobox. Show all posts

Monday, March 26, 2012

How can I programmatically know if RS is installed on a server or not

Hi,,
I have a list of SQL servers available in our network in a ComboBox ,I want
to show a message if there is no reporting service installed on a server of
user choice ,I tried to use listChildern ,,but when there is no RS ,,it
thows an Exception inside the web referenc.
ThanksOne suggestion would be to put the code calling ListChildren inside of
a Try Catch block. If you catch the exception you can display a
message box saying reporting services was not found.
More info on Try Catch can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconusingtrycatchblocktocatchexceptions.asp
The problem with this approach is you'll have to set the Url property
of the web reference and assume the report server is installed at the
default location (http://machinename/reportserver). If someone
installed the report server at a different location you'll need a more
robust mechanism to find it. I'd suggest trying WMI (windows
management instrumentation). There is an example in the docs showing
how to connect to a remote report server:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rsprog/htm/rsp_prog_wmi_6iua.asp
Note: the sample code in the docs also needs a try / catch in case the
server does not have SSRS installed.
--
Scott
http://www.OdeToCode.com/blogs/scott/
On Fri, 12 Nov 2004 11:25:32 -0800, "ALI-R" <newbie@.microsoft.com>
wrote:
>Hi,,
>I have a list of SQL servers available in our network in a ComboBox ,I want
>to show a message if there is no reporting service installed on a server of
>user choice ,I tried to use listChildern ,,but when there is no RS ,,it
>thows an Exception inside the web referenc.
>Thanks
>

Friday, February 24, 2012

how can i get database name using C#

can i get list of database name using C#.
i want to load it into combobox to easy to choice
thanks .

There is two choices are there

You can use SMO/DMO libraries

or

You can use the simple query from database

use Master
Select Name from SYSDatabases