ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Grabowski <rongrabow...@yahoo.com>
Subject Re: IBatisNet can't set SqlCommand's Connection property under Mono
Date Fri, 11 Aug 2006 04:51:20 GMT
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 <ibatis.net@gmail.com> 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..
> 


Mime
View raw message