?
Solved

Error updating sql DB from dataset

Posted on 2012-09-07
6
Medium Priority
?
375 Views
Last Modified: 2012-09-11
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
0
Comment
Question by:mark_norge
  • 4
  • 2
6 Comments
 
LVL 61

Expert Comment

by:Julian Hansen
ID: 38376856
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
 
LVL 61

Expert Comment

by:Julian Hansen
ID: 38376863
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
 

Author Comment

by:mark_norge
ID: 38376877
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 61

Accepted Solution

by:
Julian Hansen earned 2000 total points
ID: 38376937
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
 

Author Closing Comment

by:mark_norge
ID: 38385921
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
 
LVL 61

Expert Comment

by:Julian Hansen
ID: 38385931
You are welcome. Thanks for the points.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ready to get certified? Check out some courses that help you prepare for third-party exams.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question