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
mark_norgeAsked:
Who is Participating?
 
Julian HansenCommented:
You did not answer my question regarding whether you were copy from Reports table to a differerent SQLReports table - but will assume the answer is yes.

In which case I would look at the table def for each and look at field 23 to see how that is defined.
0
 
Julian HansenCommented:
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.
0
 
Julian HansenCommented:
Also you might consider asking to have this question moved to the VB.Net / .Net / SQL Server groups it does not belong in CSS
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
mark_norgeAuthor Commented:
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
0
 
mark_norgeAuthor Commented:
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
0
 
Julian HansenCommented:
You are welcome. Thanks for the points.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.