c# - Connection manager to accept either of ADO.NET or OLEDB connection types -


please @ following piece of code. accept ado.net connection type , want make work oledb well. in other words, if connectionmanager presented oledb type connection, should not fail. connect using either of ado.net or oledb (i not looking both of them @ same time).

using microsoft.sqlserver.dts.runtime.wrapper;  private sqlconnection sqlconnection;  public override void acquireconnections(object transaction) {     if (componentmetadata.runtimeconnectioncollection[0].connectionmanager != null)     {         connectionmanager cm = microsoft.sqlserver.dts.runtime.dtsconvert.getwrapper(componentmetadata.runtimeconnectioncollection[0].connectionmanager);         connectionmanageradonet cmado = cm.innerobject connectionmanageradonet;          if (cmado == null)             throw new exception("the connectionmanager " + cm.name + " not ado.net connection.");          sqlconnection = cmado.acquireconnection(transaction) sqlconnection;         sqlconnection.open();     } } 

any on appreciated! thanks.

found answer on question had posted. updated reference.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -