From: mik on
Hi, i'm using an OleDbCommandBuilder to update data from a dataset to a
access database.
It work fine, but if i use a table with a decimal column data type, i
get this error, when performing the update

Data type mismatch in criteria expression

i've understood that the error is due to the comma or dot in the decimal
representation in the sql statements, but they are created automatically
by the command builder.
Any idea on how to fix that?
Thanks


From: Alexander Vasilevsky on
Unfortunately not enough information. Please show your code and sql script.

http://www.alvas.net - Audio tools for C# and VB.Net developers


"mik" <ng(a)ms.com> �������/�������� � �������� ���������:
news:%NU_i.173882$U01.1197475(a)twister1.libero.it...
> Hi, i'm using an OleDbCommandBuilder to update data from a dataset to a
> access database.
> It work fine, but if i use a table with a decimal column data type, i
> get this error, when performing the update
>
> Data type mismatch in criteria expression
>
> i've understood that the error is due to the comma or dot in the decimal
> representation in the sql statements, but they are created automatically
> by the command builder.
> Any idea on how to fix that?
> Thanks
>
>


From: mik on
The update routine is this:
public int UpdateDataSet(DataSet ds, string selectSQL, string tableName,
DbTransaction transaction)

{

OleDbDataAdapter da = new OleDbDataAdapter(selectSQL, conn);

OleDbCommandBuilder cb = new OleDbCommandBuilder(da);

cb.QuotePrefix = "[";

cb.QuoteSuffix = "]";



cb.SetAllValues = true;




da.SelectCommand.Transaction = (OleDbTransaction)transaction;

da.RowUpdating += new OleDbRowUpdatingEventHandler(da_RowUpdating);

da.RowUpdated += new OleDbRowUpdatedEventHandler(da_RowUpdated);

cb.RefreshSchema();

OleDbCommand cmd = cb.GetUpdateCommand();



da.UpdateCommand = cmd;

return da.Update(ds, tableName);


}



this works fine except if the table i'm updating contains a decimal column
data type, in this case i get the error:

Data type mismatch in criteria expression

thanks


"Alexander Vasilevsky" <alvas(a)alvas.net> ha scritto nel messaggio
news:fhip6s$2pcg$1(a)behemoth.volia.net...
> Unfortunately not enough information. Please show your code and sql
> script.
>
> http://www.alvas.net - Audio tools for C# and VB.Net developers
>
>
> "mik" <ng(a)ms.com> �������/�������� � �������� ���������:
> news:%NU_i.173882$U01.1197475(a)twister1.libero.it...
>> Hi, i'm using an OleDbCommandBuilder to update data from a dataset to a
>> access database.
>> It work fine, but if i use a table with a decimal column data type, i
>> get this error, when performing the update
>>
>> Data type mismatch in criteria expression
>>
>> i've understood that the error is due to the comma or dot in the decimal
>> representation in the sql statements, but they are created automatically
>> by the command builder.
>> Any idea on how to fix that?
>> Thanks
>>
>>
>
>