Changing the code in SqlMapSession.CreateCommand() from this: IDbCommand command = _dataSource.DbProvider.CreateCommand(); command.CommandType = commandType; command.Connection = _connection;
to this: SqlCommand command = (SqlCommand)_dataSource.DbProvider.CreateCommand(); command.CommandType = commandType; command.Connection = _connection; solved the problem. I want to use IDbCommand and not SqlCommand. --- Gilles Bayon <[EMAIL PROTECTED]> wrote: > Its seems that the set connection on SqlCommand attend a > SqlConnection and > that a IDbConnection wa passed which cause the cast exception. You > should > check your provider.. >