471,122 Members | 1,115 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

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

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
1 7860
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.

Similar topics

reply views Thread by EStein | last post: by
2 posts views Thread by vooose | last post: by
1 post views Thread by Galen Harris | last post: by
2 posts views Thread by ruca | last post: by
3 posts views Thread by DraguVaso | last post: by
1 post views Thread by Happy | last post: by
reply views Thread by shamaila | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.