473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

SQLDMO and C#

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.
Nov 16 '05 #1
2 1899
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.

Nov 16 '05 #2
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.

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ewm | last post by:
Using InstallShield Developer 7.04. Does anyone know of a good way to detect if SQLDMO is installed? TIA mcpoo
1
by: Mohammed Abdel-Razzak | last post by:
Dear sirs I`ve used SQLDMO to make a backup to my database How can I use it to restore database? thanks Mohammed
3
by: T. | last post by:
I dumped VB and adopted C# for this version of Visual Studio. My problem! I am trying to reference an SQLDMO.Database object in C# like so: private SQLDMO.Database dbcurrent; private string...
1
by: C# beginner | last post by:
Hi all, I am using SQLDMO.Backup for backing up SQL server databases. I need to implement a progress bar to show the progress. I have some sample VB code that is like this: Dim WithEvents...
1
by: | last post by:
Hi all My requirement is to "on button_click, backup a SQL database using SQLDMO.Backup object and update the progress in a ProgressBar. The problem is the progress bar does not update at all...
2
by: | last post by:
Hi all, continued from yesterday's posting... I still haven't found a solution to this issue. I put a breakpoint in private void SqlBackupPercentComplete(string message, int Percent) {...
1
by: | last post by:
Hi all I am posting this to check if anyone could help me. The problem still persists. I am beginner in C#. Thanks. Subject: SQLDMO.Backup and ProgressBar - help please From: ...
0
by: Craig G | last post by:
i have a small application that uses the SQLDMO com object when i build a setup package to distribute it adds both the Interop.SQLDMO.dll assembly & sqldmo.dll File the problem is that the...
6
by: Craig G | last post by:
how the hell do i get this to register?!?!? my test pc is running XP & MDAC 2.8 but still it wont register SQLDMO.dll and is therefore preventing my application from running and i dont want...
3
by: Brian Henry | last post by:
Anyone know why this would happen... I added a reference to the SQLDMO COM object, imported it on top of my code.. then this test code fails Imports SQLDMO Module Module1 Sub Main() Dim...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.