Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Still getting: String or binary data would be trun

Author  Topic 

Helloise Smit
Starting Member

22 Posts

Posted - 2008-10-15 : 09:08:12
when i run my app, i still get the error above although i have checked the data lenghts!!!!when i try to write to the db

how does this work. is there a way i can pinpoint the exact data row that causes this error.

i checked all data and it is within the specified lenghts...
i dont understand....

thanks
helloise

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 09:11:00
Post the table structure and the insert statement that caused the error


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-10-15 : 09:13:45
i dont understand???? i checked my table setup/structure and had a look at the data(from another source) and no data are out of "range"
thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-15 : 09:15:16
quote:
Originally posted by Helloise Smit

i dont understand???? i checked my table setup/structure and had a look at the data(from another source) and no data are out of "range"
thanks.


check if you're doing any conctaenation in your code and if resultant length is going above max length of field
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-10-15 : 09:17:18
quote:
Originally posted by Helloise Smit

i dont understand???? i checked my table setup/structure and had a look at the data(from another source) and no data are out of "range"
thanks.


It is difficult to suggest without seeing what I asked for

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-10-15 : 09:25:07
i have a c# program and it throws an exception when i try and write to the db with this line:

sqlAdapter.Update(sqlDataSet, "" + tableName + ""); //update database with dataset
it goes to the catch section and gives the above error in the catch block. i did post this on c# forum as well and a moderator said it is a sql issue...
the table i am trying to write to consist only of varchar's, char's, numeric and a datetime types... i allowed ample "space" for addresses, tel numbers chars etc...
thanks
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-15 : 09:33:39
its due to sme value you pass from c# for saving in a varchar field.So without knowing what values you're passing and length of you fields its difficult to tell you source of error.
One thing you can do is to run profiler and then capture values passed from application and see if values are larger than target columns.
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-10-15 : 10:00:58
what is sme??? sorry.... and also how do i run profiler????

thanks
helloise
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-15 : 10:06:03
i think it should read "some value", not "sme value".


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

Helloise Smit
Starting Member

22 Posts

Posted - 2008-10-15 : 10:13:53
yes i have alot of varchar and numeric(8,6) fields but checked all of the data...its not too long or anything...
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-15 : 10:14:37
Did you read the responses you got here?
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=112606



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-15 : 11:04:32
quote:
Originally posted by Helloise Smit

yes i have alot of varchar and numeric(8,6) fields but checked all of the data...its not too long or anything...


how you checked data? by passing manually into application or capturing using profiler? also are you using stored procedures or inline query?
Go to Top of Page
   

- Advertisement -