Problem using Data.SqlClient.SqlDataAdapter

  • Thread starter Thread starter matt young
  • Start date Start date
M

matt young

I'm working on a Compact Framework PDA app which will update data on a
SQL Server. I'm using the Microsoft Data Access Application Block
v2.0. I use the method SqlHelper.CreateCommand() to build the insert,
update and delete SqlCommands.

I encounter the following SqlException when I call
SqlHelper.UpdateDataset(): "Implicit conversion from data type
sql_variant to varchar is not allowed. Use the CONVERT function to run
this query."

The insert, update and delete SqlParameters returned from
SqlHelper.CreateCommand() all have a DbType of Object and a SqlDbType
of Variant.

SqlHelper.CreateCommand() determines the type using the
SqlCommandBuilder class which calls an internal function
System.Data.SqlClient.MetaType.GetSqlDbTypeFromOleDbType() that always
returns a SqlDbType.Variant (on the .NET Compact Framework).


Am I missing some obvious workaround to this implicit conversion
error? Thanks!

Matt
 
Back
Top