Hi all I am getting this error message while try to insert data using my .net webform.
I'll appreciate all yours help.
Thank You,
and my insert command is:
Code:
Exception Details: System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near '1'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [SqlException: Line 1: Incorrect syntax near '1'.] System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +180 QualityQI.WebForm1.btnadd_Click(Object sender, EventArgs e) +1756 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33 System.Web.UI.Page.ProcessRequestMain() +1292
Thank You,
and my insert command is:
Code:
SqlCommand cmd = new SqlCommand();
cmd.Connection = sqlConnection1;
cmd.Connection.Open();
cmd.CommandText = "insert into gingercqi (QI_TRACK,DATE_RCV,INC_NUM,INC_DATE,INC_TIME,QANUM,BASE_HSP,ISSUE_IDENTIFY,MICN_INVOLVED,1ST_RESP1,1ST_RESP2,TRANSPORT1,INVESTIGATE,DATE_ASSIGN,CNE,DATE_CNE,INVPARTY1,INVPARTY2,INVPARTY3,INVPARTY4,OTHERINV,ISSUECATEGORY,ISSUEMEMO,QILEVEL,PACREPORTABLE,PACOUTCOME,CLOSEDATE,RES_CATEGORY,RES_MEMO,DISCIPLINE,DISC_TYPE,MD_REVIEW,POLICY_VIOLATION) VALUES ('"+txtqitrack.Text+"','"+Datercv.SelectedDate+"','"+ txtincnum.Text+"','"+ Dateinc.SelectedDate+"','"+txtinctime.Text+"','"+txtqanum.Text+"','"+dpbasehsp.SelectedValue+"','"+dpissueidentify.SelectedValue+"','"+txtmicninvl.Text+"','"+txt1stresp1.Text+"','"+txt1stresp2.Text+"','"+txttransport1.Text+"','"+dpinvestigate.SelectedValue+"','"+Dateasn.SelectedDate+"','"+dpcne.SelectedValue+"','"+Datecne.SelectedDate+"','"+dpinvlparty1.SelectedValue+"','"+dpinvlparty2.SelectedValue+"','"+dpinvlparty3.SelectedValue+"','"+dpinvlparty4.SelectedValue+"','"+txtotherinvl.Text+"','"+dpissuecate.SelectedValue+"','"+txtissuememo.Text+"','"+dpqilevel.SelectedValue+"','"+chkpacreport.Checked+"','"+txtpacoutcome.Text+"','"+Dateclose.SelectedDate+"','"+dpreslcate.SelectedValue+"','"+txtresolutionmemo.Text+"','"+chkdiscipline.Checked+"','"+txtdisctype.Text+"','"+chkmdreview.Checked+"','"+chkpolicyvio.Checked+"')";
cmd.ExecuteNonQuery();
cmd.Connection.Close();
Comment