I am developing a custom SSIS component for use across my entire company. Right now the code (which is from here) accepts only ADO.NET connection type.
I would like to support OLEDB type as well and would like to change my code accordingly. The piece of code that checks for valid ADO.NET connectivity is:
SqlConnection connection = connections[_connectionName].AcquireConnection(null) as SqlConnection;
if (connection == null)
{
componentEvents.FireError(0, METHOD_NAME, "The connection is not a valid ADO.NET connection", "", -1);
return DTSExecResult.Failure;
}
This would just check for a valid ADO.NET connection. How would I change this to check for OLEDB connection ALSO. So for example, if the connection type is OLEDB, it should be accepted, if its neither of those, it should fail.
I am not much of a C# person and hence I am looking for any help that I can get on this. Thanks for any help.