All you have to do is in c# create your connection etc..
create the sqlcommand to be =
select * from master..sysdata bases
or
select * from master.dbo.sysd atabases
or
select * from master.user_wit h_rights_to_mas ter.sysdatabase s
or just select name from master.dbo.sysd atabases.
now either using a sqlreader or dataadapter get the results back...
you will still need the connection to either login as win pass thru or
sql id, sql password etc...
hope this helps,
-Saras Asnani.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:<OA******* *******@tk2msft ngp13.phx.gbl>. ..
I don't believe you can create new instances of a JobServer using a
constructor. Rather, you have to add a new instance through a method
somewhere else. You will have to use that method (whatever it is, I am not
sure, I can't find it in the documentation) and then cast the return value
to that interface.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m
<an*******@disc ussions.microso ft.com> wrote in message
news:0a******** *************** *****@phx.gbl.. . Hi all, I am trying to get a reference to SQL Server
Agent from C#. I have referenced SQLDmo.dll in my
project. The SQLDmo documentation says SQLDMO.JobServe r
instance would be a reference to SQL Server Agent.
From my C# project, however, SQLDMO.JobServe r is shown as
an interface and hence I am not able to create an
instance of SQLDMO.JobServe r.
Any help is appreciated. Thanks.