JDL129
asked on
C# error message when getting a table from an adapter
Hey guys!!!
I have the following code snippet:
DataTable tblCustomersTbl = tblCustomerAd.GetDataByDAA PatId(strD AAPatID);
If I go to the adapter and run it using a valid strDAAPatID I get a record but if I run it from the code using the same value I get:
String or Binary data would be truncated
Any idea would be helpful!!!
Thanks
Jerry
I have the following code snippet:
DataTable tblCustomersTbl = tblCustomerAd.GetDataByDAA
If I go to the adapter and run it using a valid strDAAPatID I get a record but if I run it from the code using the same value I get:
String or Binary data would be truncated
Any idea would be helpful!!!
Thanks
Jerry
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No, you shouldn't if the data going to the DB is equal (or less than) the length of the data allowed by the column. Is that the *only* parameter going to the database?
ASKER
Yes, that is the only parameter. It is always 9 and the column width in sqlserver is nvarchar(50).
ASKER
Sorry for the delay but you were right on!!!!!
ASKER
The length of the values in strDAAPatID is 9 and the length in the datatable Customer is 9.
Do I need to trim the variable?
Thanks,
Jerry