Error when insertin.g data into SQL table

95 pts.
Tags:
Microsoft Visual Studio
SQL Server 2005
SQL Server 2005 Express
SQL Server tables
SQL tables
VB.NET
VB.NET 2005
VB.NET 2005 programming
Visual Studio 2005
                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.

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    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 ?
    69,175 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following