Link to home
Start Free TrialLog in
Avatar of Mark Bakelaar
Mark BakelaarFlag for Norway

asked on

Error updating sql DB from dataset

Hi Experts,

I have the following error message:
Data.SqlClient.SqlException: 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.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs 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(strSQLReports, SQLConn)
cbSQLReports = New SqlCommandBuilder(daSQLReports)

daSQLReports.FillSchema(dsSQL, SchemaType.Source, "Reports")
daSQLReports.Fill(dsSQL, "SQLReports")

The error occurs on the following
daSQLReports.Update(dsSQL.Tables("SQLReports"))

Thanks in advance,
MB
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Are you reading from Reports and Writing to SQLReports?

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.
Also you might consider asking to have this question moved to the VB.Net / .Net / SQL Server groups it does not belong in CSS
Avatar of Mark Bakelaar

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
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
You are welcome. Thanks for the points.