473,669 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Nov 16 '05 #3

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

Similar topics

2
6660
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
6333
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
5304
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 dbname; dbname = "Northwind"; dbcurrent = (SQLDMO.Database)sqlsvr.Databases.Item(dbname); But I get this error : No overload for method 'Item' takes '1' arguments.
1
1739
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 oBackupEvent As SQLDMO.Backup Set oBackupEvent = oBackup ' enable events
1
7554
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 until the very end of the backup process, when the backup is almost going to be over, the progress bar updates itself once on a stretch, which is no use,it is not showing any progress. SQLDMO documentation says, the SQLDMO.Backup object fires
2
5510
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) { progressBar1.Value = Percent; progressBar1.Update(); }
1
2554
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: "anonymous@discussions.microsoft.com" <anonymous@discussions.microsoft.com> Sent: 11/11/2004 5:52:10 AM
0
1585
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 interop.SQLDMO.dll has a dependancy on my local sqldmo.dll and appears in the dependencies box as "C:\Program Files\Microsoft SQL Server......"
6
8956
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 to have to install SQL2000 Client on the test pc
3
1429
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 i As Integer
0
8895
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2032
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1788
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.