I got this error:
Source Error:
Line 63: protected void btn_save_add_Click(object sender, EventArgs e) Line 64: { Line 65: pcd.Pro_Comp_ID = Convert.ToInt32(txt_prod_of_compID_add.Text); Line 66: Line 67: //int companyId = Convert.ToInt32(ddl_choose_companyName.SelectedValue);
I revise 'Pro_Comp_ID' in sql and .net it all of datatype 'int' where is the error?
check if the textbox have value or null
if(string.IsNullOrEmpty(txt_prod_of_compId_add.Text)) { // its null textbox } else { // not null, do what ever you want }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.