У меня была такая же проблема.Решено следующим образом:
private static IDbCommand SetupCommand(IDbConnection cnn, IDbTransaction transaction,
string sql, Action<IDbCommand, object> paramReader,
object obj, int? commandTimeout,
CommandType? commandType)
{
var cmd = cnn.CreateCommand();
var bindByName = GetBindByName(cmd.GetType());
if (bindByName != null) bindByName(cmd, true);
if (transaction != null)
cmd.Transaction = transaction;
cmd.CommandText = sql;
if (commandTimeout.HasValue)
cmd.CommandTimeout = commandTimeout.Value;
if (commandType.HasValue)
cmd.CommandType = commandType.Value;
if (paramReader != null)
{
paramReader(cmd, obj);
}
//CODTEC SISTEMAS
foreach (System.Data.SqlServerCe.SqlCeParameter item in cmd.Parameters)
{
if (item.SqlDbType == System.Data.SqlDbType.VarBinary)
item.SqlDbType = System.Data.SqlDbType.Image;
}
//CODTEC SISTEMAS
return cmd;
}