Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8334797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:27:53+00:00 2026-06-09T03:27:53+00:00

Am running a simple application on asp.net that is taking input from text boxes

  • 0

Am running a simple application on asp.net that is taking input from text boxes on various pages and then on the last page am using the insertion method through adapters. when i use dummy inputs like hjihi for the text boxes am not getting an exception. how ever when i use proper inputs for fields i get this whole page of horridly error. Searched it but cudn’t get a proper answer.

Server Error in '/Job Portal10' 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:

Line 6127:            }
Line 6128:            try {
Line 6129:          int returnValue =    this.Adapter.InsertCommand.ExecuteNonQuery();
Line 6130:                return returnValue;
Line 6131:            }

Source File: c:\Users\Haris Riaz\AppData\Local\Temp\Temporary ASP.NET Files\job portal10\a1906c7c\e3e5272e\App_Code.6jqq8vva.1.cs Line: 6129

Stack Trace:
[SqlException (0x80131904): String or binary data would be truncated.
The statement has been terminated.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +2030802
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +5009584
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +234
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2275
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +215
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +987
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) +178
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
DataSet1TableAdapters.Emp_UpdateTableAdapter.Insert(String Title, String First_Name, String Last_Name, String F_First_Name, String F_Last_Name, String Gender, String Nationality, String Maritial_Status, String DOB, String CNIC, String Domicile, String Dependents, String Qualification_10Years, String Board_10_Years_Edu, String Completion_10_years, String Percmarks_10_Years, String Division_10_Years, String Qualification_12_years, String Board_12_years_Edu, String Completion_12_years, String Percmarks_12_Years, String Division_12_years, String Qualification_16_years, String Board_16_years_Edu, String Completion_16_years, String Percmarks_16_Years, String Division_16_years, String Qualification_18_years, String Board_18_years_Edu, String Completion_18_years, String Percmarks_18_Years, String Division_18_years, String Qualification_21_years, String Board_21_years_Edu, String Completion_21_years, String Percmarks_21_Years, String Division_21_years, String exp_1_Organization, String Designation_1, String Duration_From_1_1, String Duration_From_1_2, String Address_1, String Contact_1, String Supervisor_1, String Jobreason_1, String StartingSalary_1, String EndingSalary_1, String exp_2_Organization, String Designation_2, String Duration_From_2_1, String Duration_From_2_2, String Address_2, String Contact_2, String Supervisor_2, String Jobreason_2, String StartingSalary_2, String EndingSalary_2, String exp_3_Organization, String Designation_3, String Duration_From_3_1, String Duration_From_3_2, String Address_3, String Contact_3, String Supervisor_3, String Jobreason_3, String StartingSalary_3, String EndingSalary_3, String Permanent_Address, String Current_Address, String Permanent_City, String Current_City, String Permanent_Country, String Phone_Number, String Mobile_Number, String Email_Address, String Fax, String Ref_Name_1, String Ref_Designation_1, String Ref_Org_1, String Ref_Email_1, String Ref_Add_1, String Ref_Mobile_1, String Ref_Name_2, String Ref_Designation_2, String Ref_Org_2, String Ref_Email_2, String Ref_Add_2, String Ref_Mobile_2, String Ref_Name_3, String Ref_Designation_3, String Ref_Org_3, String Ref_Email_3, String Ref_Add_3, String Ref_Mobile_3) in c:\Users\Haris Riaz\AppData\Local\Temp\Temporary ASP.NET Files\job portal10\a1906c7c\e3e5272e\App_Code.6jqq8vva.1.cs:6129
UpdateProfile.Button1_Click(Object sender, EventArgs e) in c:\Users\Haris Riaz\Desktop\apna kaam\Job Portal10\UpdateProfile_References.aspx.cs:58
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +112
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563

Here is my c# i used with my button

public partial class UpdateProfile : System.Web.UI.Page
{

    DatabaseConnect DB = new DatabaseConnect();
    DataSet1TableAdapters.Emp_UpdateTableAdapter td = new   DataSet1TableAdapters.Emp_UpdateTableAdapter();

static public String ref_name_1;
static public String ref_designation_1;
static public String ref_org_1;
static public String ref_email_1;
static public String ref_add_1;
static public String ref_mobile_1;
static public String ref_name_2;
static public String ref_designation_2;
static public String ref_org_2;
static public String ref_email_2;
static public String ref_add_2;
static public String ref_mobile_2;
static public String ref_name_3;
static public String ref_designation_3;
static public String ref_org_3;
static public String ref_email_3;
static public String ref_add_3;
static public String ref_mobile_3;

protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
    ref_name_1 = TextBox10.Text;
    ref_designation_1 = TextBox11.Text;
    ref_org_1 = TextBox12.Text;
    ref_email_1 = TextBox13.Text;
    ref_add_1 = TextBox14.Text;
    ref_mobile_1 = TextBox28.Text;
    ref_name_2 = TextBox16.Text;
    ref_designation_2 = TextBox17.Text;
    ref_org_2 = TextBox18.Text;
    ref_email_2 = TextBox19.Text;
    ref_add_2 = TextBox20.Text;
    ref_mobile_2 = TextBox29.Text;
    ref_name_3 = TextBox22.Text;
    ref_designation_3 = TextBox23.Text;
    ref_org_3 = TextBox24.Text;
    ref_email_3 = TextBox25.Text;
    ref_add_3 = TextBox26.Text;
    ref_mobile_3 = TextBox30.Text;

    td.Insert(Session["Titl"].ToString(),
     Session["First_Name"].ToString(), 
     Session["Last_Name"].ToString(),
     Session["F_First_Name"].ToString(),
     Session["F_Last_Name"].ToString(),
     Session["Gender"].ToString(),
     Session["Nationality"].ToString(),
     Session["Maritial_Status"].ToString(),
     Session["DOB"].ToString(),
     Session["CNIC"].ToString(),
     Session["Domicile"].ToString(),
     Session["Dependents"].ToString(),
     Session["Qualification_10Years"].ToString(),
     Session["Board_10_Years_Edu"].ToString(), 
     Session["Completion_10_years"].ToString(),
     Session["Percmarks_10_Years"].ToString(),
     Session["Division_10_Years"].ToString(), 
     Session["Qualification_12Years"].ToString(),
     Session["Board_12_Years_Edu"].ToString(), 
     Session["Completion_12_years"].ToString(),
     Session["Percmarks_12_Years"].ToString(), 
     Session["Division_12_Years"].ToString(), 
     Session["Qualification_16Years"].ToString(), 
     Session["Board_16_Years_Edu"].ToString(),
     Session["Completion_16_years"].ToString(),
     Session["Percmarks_16_Years"].ToString(),null, 
     Session["Qualification_18Years"].ToString(), 
     Session["Board_18_Years_Edu"].ToString(),
     Session["Completion_18_years"].ToString(),
     Session["Percmarks_18_Years"].ToString(),null, 
     Session["Qualification_21Years"].ToString(),
     Session["Board_21_Years_Edu"].ToString(),
     Session["Completion_21_years"].ToString(), 
     Session["Percmarks_21_Years"].ToString(),null, 
     Session["exp_1_Organization"].ToString(),
     Session["Designation_1"].ToString(),
     Session["Duration_from_1_1"].ToString(),
     Session["Duration_from_1_2"].ToString(),
     Session["address_1"].ToString(),
     Session["contact_1"].ToString(),
     Session["supervisor_1"].ToString(),
     Session["job_reason_1"].ToString(),
     Session["starting_salary_1"].ToString(),
     Session["ending_salary_1"].ToString(),
     Session[" exp_2_Organization"].ToString(),
    Session[" Designation_2"].ToString(),
    Session[" Duration_from_2_1"].ToString(),
    Session[" Duration_from_2_2"].ToString(),
    Session[" address_2"].ToString(),
    Session[" contact_2"].ToString(),
    Session[" supervisor_2"].ToString(),
    Session[" job_reason_2"].ToString(),
    Session[" starting_salary_2"].ToString(),
    Session[" ending_salary_2"].ToString(),
    Session[" exp_3_Organization"].ToString(),
    Session[" Designation_3"].ToString(),
    Session[" Duration_from_3_1"].ToString(),
    Session[" Duration_from_3_2"].ToString(),
    Session[" address_3"].ToString(),
    Session[" contact_3"].ToString(),
    Session[" supervisor_3"].ToString(),
    Session[" job_reason_3"].ToString(),
    Session[" starting_salary_3"].ToString(),
    Session[" ending_salary_3"].ToString(),
    Session["permanent_address"].ToString(),
    Session["current_address"].ToString(),
    Session["permanent_city"].ToString(),
    Session["current_city"].ToString(),
    Session["permanent_country"].ToString(),
    Session["phone_number"].ToString(),
    Session["mobile_number"].ToString(),
    Session["email_address"].ToString(),
    Session["fax"].ToString(),
    ref_name_1,
     ref_designation_1,
     ref_org_1,
     ref_email_1,
     ref_add_1,
     ref_mobile_1,
     ref_name_2,
     ref_designation_2,
     ref_org_2,
     ref_email_2,
     ref_add_2,
     ref_mobile_2,
     ref_name_3,
     ref_designation_3,
     ref_org_3,
     ref_email_3,
     ref_add_3,
     ref_mobile_3);


}

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:27:55+00:00Added an answer on June 9, 2026 at 3:27 am

    Exception Details: System.Data.SqlClient.SqlException: String or
    binary data would be truncated.

    This error indicates you’re trying to insert some data, that is longer/larger than a specified column type. A simple example: you’ve specified a column of a type varchar(200), but you’re trying to insert a string of length 500.

    To prevent exceptions like this, I’d suggest to implement some kind of a client-side (+ server-side, of course) validation of inputted data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net application running under IIS 6. A simple page has two
I have a client running an ASP.NET application. Inside of that, there's a self-contained
I have a ASP.NET 1.1 application running on IIS 6 / Windows Server 2003.
I have a very simple app on my local machine that uses the ASP.NET
I have inherited an ASP.NET 3.5 application that relies heavily on sessions and storing
I have a sample ASP.NET application that I will use in classroom setting. Each
Am running asp.net application.I try to build sample site using gridview.I got compilation error
I'm building a asp.net mvc web application. And I'm running quartz in the asp.net
I've run into a problem that's driving me crazy. In my application (ASP.NET MVC2
I noticed that in my ASP.NET application the Application_AuthenticateRequest event handler is being called

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.