95 pts.
 Error when insertin.g data into SQL table
                I'm using SQL Server 2005 Express edition as the Database and Microsoft VB.NET 2005 as the programming language for my project. At the moment I'm having a problem of inserting data into one of the tables in my database through my VB.NET application. I did successfully inserted data through my application to 5 tables in my database. But in this particular table only I get the error: "String or binary data would be turncated. The Statement has been terminated". This message is coming from the .NET SqlClient data provider. I then tried to insert the same data through SQL server Management Studio query editor and it worked without any problems. What might be the reason for this problem? 
                I also re-ran the other parts of my application where I successfully inserted data into the 5 tables and they worked fine. Please help!!!!   


Software/Hardware used:
Micorsoft Visual Studio 2005/VB.NET 2005, Microsoft SQL Server 2005 Express edition.
ASKED: September 26, 2009  10:31 AM
UPDATED: September 28, 2009  5:44 PM

Answer Wiki:
One of the text or binary fields in the table is smaller than the value you are trying to put into it. You need to limit the size of the value or increase the size of the field.
Last Wiki Answer Submitted:  September 26, 2009  9:33 pm  by  Denny Cherry   64,520 pts.
All Answer Wiki Contributors:  Denny Cherry   64,520 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Are you completely sure you successfully inserted the same data through Management Studio ?
I suppose you are not inserting fixed values, but values stored in program variables. Have you checked the contents of those variables before performing the insert to verify they in fact contain what you think they contain ?

 63,535 pts.