Invoking DbCommandSetDataProvider.AddCommand with a OleDbCommand with an open OleDBConnection as the first parameter, closes the attached connection.
Is there a way to prevent this?
The reason is I use Application Roles in my SQL Server database and the OleDbCommand,Connection has switched roles and the connection now has the necessary permissions.
C# code:
private OleDbConnection _oleDbConnection;
private OleDbCommand _oleStoredProcedureCommand;
protected readonly DbCommandSetDataProvider DataProvider = new DbCommandSetDataProvider();
// _oleStoredProcedureCommand.Connection.State = Open
DataProvider.AddCommand(_oleStoredProcedureCommand, ProcedureName);
// _oleStoredProcedureCommand.Connection.State = Closed