By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,636 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,636 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Mar 1 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"languy" wrote:
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

Mar 1 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.