All you have to do is in c# create your connection etc..
create the sqlcommand to be =
select * from master..sysdatabases
or
select * from master.dbo.sysdatabases
or
select * from master.user_with_rights_to_master.sysdatabases
or just select name from master.dbo.sysdatabases.
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.com> wrote in message news:<OA**************@tk2msftngp13.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.com
<an*******@discussions.microsoft.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.JobServer
instance would be a reference to SQL Server Agent.
From my C# project, however, SQLDMO.JobServer is shown as
an interface and hence I am not able to create an
instance of SQLDMO.JobServer.
Any help is appreciated. Thanks.