Showing posts with label custom. Show all posts
Showing posts with label custom. Show all posts

Monday, March 12, 2012

OleDB Connection Class in Custom Task?

I have OLE DB Connections set up in my connection manager (Native OLE DB\Microsoft OLE DB Provider for SQL Server). I would like to reference and query these connections from a custom task, written in C#. I currently reference it as follows:

using System.Data.OleDb;

...................................

OleDbConnection connection = (OleDbConnection) connections["MyConnection"].AcquireConnection(null);

What may be obvious to some (though wasn't to me, as I am new at this), when I run the task, I get an error saying that I cannot make this cast. After perusing the boards, I understand that this is because I am not making a cast to the right connection type. Well, that is where I am lost. What connection type (and corresponding library) do I need to reference? I want to continue to use the "Native OLE DB..." connection.

Thanks!

The OleDb connection manager is for tasks and data flow components that use unmanaged OleDb API.
Since you want managed connection object, use ADO.NET connection manager, select the same provider (Native OLE DB\Microsoft OLE DB Provider for SQL Server).

|||Makes sense. I don't know much about connection managers, but this helps. I'll give it a shot. Thanks!

Saturday, February 25, 2012

OLE DB Connection String for FTP?

Does there exist an OLE DB Connection string for FTP? If so what is the format? I'm trying to build a custom connection manager and I'm not sure what the supplied connection string will look like for FTP. Thanks in advance.Probably not, no. You could write your own, I suppose.

Doubtful you will find an OLE driver for FTP. There exists an FTP task, though!