Hello Team,
I am getting error "Incorrect syntax near ')'.".How to fix the issue.
string insertQuery = string.Format(
"Insert into CUSTOMERLOANDATA(Firstname,MiddleName,LastName,FullAddress,MobileNo1,EmailID,DOB,Loan1IntrRate,Loan1Amt,Loan2IntrRate,Loan2Amt,DateOfEMI,ReleaseDate,HouseType,Salary,CustomerLoanOCRId,CustomerAddr1,CustomerAddr2,Landmark,State,City,Pincode) values('{0}','{1}','{2}','{3}',{4},'{5}',{6},{7},{8},{9},{10},{11},{12},'{13}',{14},{15},'{16}','{17}','{18}','{19}','{20}',{21})",
customerLoanRecord.FirstName, ////0
customerLoanRecord.MiddleName, ////1
customerLoanRecord.LastName, ////2
customerLoanRecord.FullAddress, ////3
customerLoanRecord.MobileNo1, ////4
customerLoanRecord.EmailID, ////5
(customerLoanRecord.DOB.HasValue ? "'" + customerLoanRecord.DOB.Value.ObjectToDBDateTime() + "'" : "null"), ////6
customerLoanRecord.Loan1IntrRate, ////7
customerLoanRecord.Loan1Amt, ////8
customerLoanRecord.Loan2IntrRate, ////9
customerLoanRecord.Loan2Amt, ////10
(customerLoanRecord.DateOfEMI.HasValue ? "'" + customerLoanRecord.DateOfEMI.Value.ObjectToDBDateTime() + "'" : "null"), ////11
(customerLoanRecord.ReleaseDate.HasValue ? "'" + customerLoanRecord.ReleaseDate.Value.ObjectToDBDateTime() + "'" : "null"), ////12
customerLoanRecord.HouseType, ////13
customerLoanRecord.Salary, ////14
customerLoanRecord.CustomerLoanOCRId, ////15
customerLoanRecord.CustomerAddr1, ////16
customerLoanRecord.CustomerAddr2, ////17
customerLoanRecord.Landmark, ////18
customerLoanRecord.State, ////19
customerLoanRecord.City, ////20
customerLoanRecord.Pincode);
Thanks Harshal Raut