473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 8035
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: EStein | last post by:
I am trying to update information in a SQL database using vb.net web forms. I have been able to add information to a datagrid, but when I try to actually update the SQL database from the dataset,...
0
by: Nathan Guill | last post by:
I'm new to .net (only know VBA and LISP), so I would appreciate some help if possible. I have a treeview that I fill using an access database. Upon selection of one of the child nodes, the...
2
by: vooose | last post by:
Consider a server executing "SELECT * FROM Settings WHERE UserID=@UserID" which is loaded into a DataSet and then we use dataSet.GetXML() to send this to the requesting client. The client...
1
by: Galen Harris | last post by:
What's the best practice to use the dataadapter.update on a dataset that's been stored in session? We create a dataset on one page, and later in site, we want to call the dataadapter.update() to...
2
by: ruca | last post by:
Hi, Can I update a DataSet or a DataTable using something like object.Update() ??? I was looking for something and I find out this functions, but I don't know for real what they do....
0
by: Samy | last post by:
Hi There, I am trying to trace the block of code which had adapter.update(dataset). The adapter has the insert, update and delete commands defined on them along with the select command. Is there a...
3
by: DraguVaso | last post by:
Hi, I have to update Some records in a DataSet, I now use this functions: Dim NewDataRow As DataRow 'dtsXmldFormSettings = the DataSet NewDataRow =...
9
by: jaYPee | last post by:
I have search a lot of thread in google newsgroup and read a lot of articles but still i don't know how to update the dataset that has 3 tables. my 3 tables looks like the 3 tables from...
1
by: Happy | last post by:
hi how to update dataset's row thru code i got the new row as a data row in which the primary key remains the same but was unable update the non primary keys Thanks in Advance
0
by: shamaila | last post by:
i m using dataadapter to handle dataset..the date is shown in the datagrid..now i want to update the records edited by the user i have used one button to show the records,(in which i hv declared...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.