Saturday, 15 June 2013

This is a c# coding with sql. Syntax error when value changes -


I am in newbie c # and sql. My code is showing a syntax error when I am inserting a contact with 10 digits There is no error when there is less compared to it. The data type in the table is also big int. I am using SQL Server 2008. help please. Code is given below.

  Enter in the ReceiveChallanPrint1 (Invoices, Reference No, Title, Author, ISBN, Transaction, Receipt, Publisher, Publisher Other, Publisher, Contact, Anyone, Publisher E- Mail, "+" template subtitle, template body, email attachment 1 "+") "; SQuery = sQuery + "values ​​("; sQuery = sQuery + "'+ + Convert.ToInt32 (dgvChallanActive.Rows [i]. [" Invoice not "]. Value.ToString ()) +"', '; SQuery = "+++" "+" Convert.Tint32 (dgvChallanActive.Rows [i] .sec ["ReferenceNo"]. Value.ToString ()) + "','; sQuery = sQuery +" '+ + Convert.ToString (DgvChallanActive.Rows [i]. [["Title"]. Value) + "',"; sQuery = sQuery + "'" + Convert. ToString (dgvChallanActive.Rows [i]. [["Author1"]. Value ) "", "; SQuery = sQuery +" '"+ dgvChallanActive.Rows [i] .seel [" ISBN "]. Value" ","; sql = sQuery + "' '+ Convert. ToString (dgvChallanActive.Rows [ I] ("invoice"]. Value) + "', sql = sQuery +"' "+ dtp receipt value. Shortcut datatyping () +" ','; sQuery = sQuery + "'" + + convert ToString (dgvChallanActiv E ["Publisher"]. Value) + "',"; sQuery = sQuery + "'" + "Convert.tostring (DGV Cholan Active.ROS [I]. [" Publisher Other "]. Value)" " , '; // sQuery = SQuery + "" + "Convert.ToInt32 (dgvChallanActive.Rows [i]. [" Publisher Communication None "]. Value.ToString ()) + "', SQuery = sQuery +"' "+ Convert.ToInt32 (dgvChallanActive.Rows [i]." ["Publisher None"]. Value.ToString ()) + "',' ; SQuery = sQuery + "+" Convert. ToString (dgvChallanActive.Rows [i]. ["PublisherEmail"]. Value) + ''; SQuery = sQuery + '' '+ "Convert .ToString (cboEmailTemplate.Text) + "','; SQuery = sQuery + "'" + sSubject + "', 'SQuery = sQuery +"' "+ + sBody +" ','; SQuery = sQuery + "'" + LLL Attachment. Text.Trim () + "'"; SQuery = sQuery + ")"; DBireation Deportation Conection string = globalfunction.svg connection string; SRetVal = DBOperation.ExecuteDBOperation (sQuery, DBOperation.OperationType.INSERT, Zero, Ref DT); If (sRetVal! = GlobalFuncs.SUCCESS) {MessageBox.Show ("Do not insert"); } Return sRetVal; } Hold (ex before) {return ex.Message; }  

As I have used the debugging option in this code, so after attempting any publication, this attempt comes out of the box. I'm taking data from Gridview.

change Convert.ToInt32 (DgvChallanActive.Rows [i]. ["PublisherContactNo"]. Value.ToSt Ring ()) to Convert.ToInt64 (dgvChallanActive.Rows [i] .sec ["PublisherContactNo"]. Value .Off Ring ())


No comments:

Post a Comment