473,395 Members | 1,756 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,395 software developers and data experts.

How to call C# dll from sql server 2000 dts?

Using SQL Server 2000, Visual Studio 2005, .NET 2.0 and C#.
>From a SQL Server 2000 DTS package is it possible to call a C# dll
passing one parameter and having two parameters returned?

Thanks,
Sal

Aug 16 '07 #1
5 2222
You can NEVER return two parameters. You can return XML, or similar, and
parse. Or you can pass one parameter by reference and alter it, but your
return type is always singular.

Having said that ... there are some possibilities here. The issue here is
getting DTS to talk to anything, as it likes scripting. Move up to SSIS
(2005) and some of the problem goes away.

But, it is possible to hit COM. And, that means if you COM wrap .NET
components you can use them. Have never tried, so there is no way I can give
you a step by step. With SQL 2000, you can export the package to VB and then
call the COM wrapper from there, so I know that is possible, but it is also
a pain to do if you move the package out to VB too early, as editing DTS in
COM is painful (did it once .... once).

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box! |
*************************************************
<ro****@gmail.comwrote in message
news:11**********************@i13g2000prf.googlegr oups.com...
Using SQL Server 2000, Visual Studio 2005, .NET 2.0 and C#.
>>From a SQL Server 2000 DTS package is it possible to call a C# dll
passing one parameter and having two parameters returned?

Thanks,
Sal

Aug 16 '07 #2
Unfortunately switching to 2005 is not possible at this time.
Returning one parameter would work. I just haven't seen an example of
how to create a COM object with .NET 2.0 that is accessible with DTS
or an extended stored procedure.

Thanks,
Sal

Aug 16 '07 #3
I just haven't seen an example of
how to create a COM object with .NET 2.0 that is accessible with DTS
or an extended stored procedure.
It's outside the scope of this group, but google .net and com and you'll
find loads of examples on the net. It's very simple, just create a normal
class with an interface and fixed guid, compile it and use the command line
tool "regasm" to create and register a COM wrapper for you. You can now
call it via your DTS script using;

set obj = CreateObject("MyProject.MyClass")
obj.MyMethod ()

Quick search on "exposing .net class com" found this

http://www.codeproject.com/dotnet/nettocom.asp
Aug 16 '07 #4
One way would be to COM enable your C# dll, register it on the same box where
your SQL Server runs - then you should be able to use it the same way as any
other COM objects inside ActiveX scripting task

"ro****@gmail.com" wrote:
Using SQL Server 2000, Visual Studio 2005, .NET 2.0 and C#.
From a SQL Server 2000 DTS package is it possible to call a C# dll
passing one parameter and having two parameters returned?

Thanks,
Sal

Aug 17 '07 #5
Thanks. I forgot this was the ASP.NET forum. Most of my time is with
ASP.NET/AJAX.

Aug 17 '07 #6

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

Similar topics

1
by: Aston | last post by:
I have this stored procedure that takes a few parameters like date and merchant ID, and basically goes through a set of if-then statements to build a SQL SELECT string. When we upgraded from SQL...
15
by: chirs | last post by:
I am trying to understand a piece of code. In a javascrpit file, there is a function: function ItemStyle(){ var names=; addProps(this,arguments,names,true); }; In the html file, it calls...
2
by: mike | last post by:
H There are two ways to execute a stored procedure using ADO.NE - call "exec sp_myproc val1,val2" statement over SqlCommand myCommand = new SqlCommand(SQLQuery, mySqlConnection) - use...
6
by: Von Shean | last post by:
I have already posted my problem. but now after some diagnosis i have a clear question! I use a dll which is in com+. so when i call any function of that dll from asp.net the call hangs or a...
1
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try...
4
by: Sara | last post by:
How to call a .net dll method from sql server 2000 stored procdure
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
5
by: Pedro Vera | last post by:
I am helping somebody setup one of the asp.net starter kits. I converted it from sql express to sql server with no real issues, and I got it running local perfectly. On my first attempt to run...
0
by: madhusr | last post by:
I have a requirement where in in I need to call a SQL Server 2000 stored procedure from DB2 (ver 8.x) based on a value in a column. I can create a trigger in DB2 to monitor the column and after the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.