SqlDataAdapter.Update(DataSet, string) -> String or binary data would be truncated.

  • Thread starter Thread starter languy
  • Start date Start date
L

languy

Hi there

I'm having a problem when using the SqlDataAdapter. When calling the
Update(DataSet, string) method I get the following error message "String or
binary data would be truncated". The rows neither have data that exceeds
8000 chars nor contain any LOB fields. Furthermore the data is transferred
between two tables that are bitwise identical.

-- snip --
System.Data.SqlClient.SqlCommand command =
this.xxxConnection.CreateCommand();
command.Transaction=this.xxxTransaction;
SqlDataAdapter adapter = (System.Data.SqlClient.SqlDataAdapter)
this.xxxAdapters[adaptertablename];
adapter.Update(ds, dbtablename);
-- snip --

The snip above illustrates how I'm using the SqlDataAdapter, where the
"xxxAdapters" is a Hashtable containing each SqlDataAdapter that is indexed
by the name of the table that each adapter represents.

I hope for a soon reply on this.

Thanks in regards
Jess
 
Does your SqlDataAdapter have the required SqlCommands it needs (e.g.,
select, insert, update, delete)?

Have you set the correct type of these commands as CommandType.Text or
CommandType.StoredProcedure?
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top