Mark Bakelaar
asked on
Error updating sql DB from dataset
Hi Experts,
I have the following error message:
Data.SqlClient.SqlExceptio n: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 23 ("@p21"): The supplied value is not a valid instance of data type real. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.
at System.Data.Common.DbDataA dapter.Upd atedRowSta tusErrors( RowUpdated EventArgs rowUpdatedEvent, BatchCommandInfo[] batchCommands, Int32 commandCount)
How can I get the name and/or value of parameter 23 to troubleshoot this? DataSet is filled as follows
Dim strSQLReports As String = "SELECT * FROM Reports"
daSQLReports = New SqlDataAdapter(strSQLRepor ts, SQLConn)
cbSQLReports = New SqlCommandBuilder(daSQLRep orts)
daSQLReports.FillSchema(ds SQL, SchemaType.Source, "Reports")
daSQLReports.Fill(dsSQL, "SQLReports")
The error occurs on the following
daSQLReports.Update(dsSQL. Tables("SQ LReports") )
Thanks in advance,
MB
I have the following error message:
Data.SqlClient.SqlExceptio
at System.Data.Common.DbDataA
How can I get the name and/or value of parameter 23 to troubleshoot this? DataSet is filled as follows
Dim strSQLReports As String = "SELECT * FROM Reports"
daSQLReports = New SqlDataAdapter(strSQLRepor
cbSQLReports = New SqlCommandBuilder(daSQLRep
daSQLReports.FillSchema(ds
daSQLReports.Fill(dsSQL, "SQLReports")
The error occurs on the following
daSQLReports.Update(dsSQL.
Thanks in advance,
MB
Also you might consider asking to have this question moved to the VB.Net / .Net / SQL Server groups it does not belong in CSS
ASKER
Hi Julian,
Do you know however how to find out what the fieldname and value are of parameter 23?
This would narrow down the troubleshooting.
Thanks, Mark
Do you know however how to find out what the fieldname and value are of parameter 23?
This would narrow down the troubleshooting.
Thanks, Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Julian,
Indeed the answer was yes and you where correct in your first reply. Took time to find what caused it. Thanks for the help. MB
Indeed the answer was yes and you where correct in your first reply. Took time to find what caused it. Thanks for the help. MB
You are welcome. Thanks for the points.
If so the error is saying that there is a type mismatch between the two
Check the field defs between the two tables and make sure the types match exactly.
for instance if one is decimal and the other is a float it could cause this error.