473,480 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

System.Data.SqlClient.SqlException: String or binary data would be truncated. The sta

1 New Member
Server Error in '/marksform' Application.

String or binary data would be truncated.
The statement has been terminated.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: String or binary data would be truncated.
The statement has been terminated.

Source Error:


Expand|Select|Wrap|Line Numbers
  1. Line 61:         SqlCommand cmd = new SqlCommand("insert into resultspage2 values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + RadioButtonList1.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + TextBox5.Text + "','" + TextBox6.Text + "','" + TextBox7.Text + "','" + TextBox8.Text + "','" + TextBox9.Text + "','" + TextBox10.Text + "','" + TextBox11.Text + "','" + TextBox12.Text + "')", con);
  2. Line 62:         con.Open();
  3. Line 63:         cmd.ExecuteNonQuery();
  4. Line 64:         Label1.Text="data inserted successfully";
  5. Line 65:         con.Close();
Source File: c:\Users\kclink\Desktop\marksform\maksf.aspx.cs Line: 63

Stack Trace:


[SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlExc eption exception, Boolean breakConnection) +2030802
System.Data.SqlClient.SqlInternalConnection.OnErro r(SqlException exception, Boolean breakConnection) +5009584
System.Data.SqlClient.TdsParser.ThrowExceptionAndW arning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlCommand.RunExecuteNonQuer yTds(String methodName, Boolean async) +228
System.Data.SqlClient.SqlCommand.InternalExecuteNo nQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +326
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
maksf.Button1_Click(Object sender, EventArgs e) in c:\Users\kclink\Desktop\marksform\maksf.aspx.cs:63
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEven t(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
May 22 '14 #1
1 6163
Rabbit
12,516 Recognized Expert Moderator MVP
Please use code tags when posting code or formatted data.

That error means you're trying to insert data that is too big for the column you're trying to insert it into.
May 23 '14 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2107
by: Kalyan | last post by:
Hello, System.Data.SqlClient.SqlException: General network error. Check your network documentation. What does this error means? My web app, suddenly started to show this error today in my...
1
4573
by: Kal | last post by:
Hello, System.Data.SqlClient.SqlException: General network error. Check your network documentation. What does this error means? My web app, suddenly started to show this error today in my...
3
6030
by: Patrick.O.Ige | last post by:
Hi guys, I'm getting error:- System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '='. What could cause this ERRORR My code below:- Dim connString As String =...
0
4064
by: Ersin Gençtürk | last post by:
we are getting : System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.Data.SqlClient.SqlException: Timeout expired. The timeout period...
1
2893
by: HK | last post by:
I just moved an ASP.NET application to a new web server at a different location of ours. The SQL Server machine was moved to that new location at the same time as the web site DNS was pointed to...
5
6569
by: Rod | last post by:
I have a client site where the code below has been working happily for at least four months. The site is using SQL Server 7. The code is ASP.NET Last week an error appeared related to the...
3
24220
by: weird0 | last post by:
This is the exception that I get when i create a webserivce obj and call. The error comes on the webmethod call, when it opens a connection to the db. How do I fix it? What is the solution to...
1
2776
by: thithi | last post by:
Please help me " System.Data.SqlClient.SqlException: Prepared statement '(@Name varchar(100),@Describes varchar(100),@Money char(10))Upda' expects parameter @Describes, which was not supplied. at...
2
4707
by: lily86 | last post by:
i'm very new so i hope all of u can help me. when i debug my webforms this error occur "An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll Additional...
0
7039
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
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7037
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
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5326
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,...
1
4770
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...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.