I'm working on a simple form to database program but I keep encountering a syntax error with my SQL statement.
Since it's so long, I don't want to parameterize it, but I will if it's the only way...please don't suggest that first.
Edit: I just tried placing [] around all column names, no success.
Since it's so long, I don't want to parameterize it, but I will if it's the only way...please don't suggest that first.
Code:
String strSQL = "INSERT INTO Grant (CFDAnum,ProgramTitle,DueDate,SubmitDate,Developer,Dept,ContactName,Phone,Email,AwardAmount,Match(Y/N),FundingType,FedGrantnum," +
"PassThru,GrantContactName,GrantPhone,GrantEmail,ImmediateGrantorAgency,AgencyContactName,AgencyContactPhone,AgencyContactEmail,NoticeofAwardDate,FYFunding, " +
"TermofAgreementDate,ExpirationDate,FSR1Due,FSR1Submit,FSR2Due,FSR2Submit,FSR3Due,FSR3Submit,FSR4Due,FSR4Submit,ReportingComplianceNotesandComments," +
"FiscalOrderDeadline,CouncilApproval,GrantCode,GrantDetail,Budget,FundCode,IndexCode,RevenueSubobject,1stQtrBal,2ndQtrBal,3rdQtrBal,4thQtrBal,YearEnd,Comments) " +
"VALUES('" + txtCFDA.Text + "','" + txtPrgrmTitle.Text + "','" + txtDueDate.Text + "','" + txtSubDate.Text + "','"
+ txtDev.Text +"','" + txtDept.Text + "','" + txtContactName.Text + "','" + txtDeptPhone.Text + "','" + txtDeptEmail.Text + "','" + txtAwardAmt.Text +
"','" + txtMatch.Text + "','" + cboFundType.SelectedItem + "','" + txtFedGNum.Text + "','" + cboPassThru.SelectedItem + "','" + txtGrantContact.Text
+ "','" + txtGrantPhone.Text + "','" + txtGrantEmail.Text + "','" + txtImmGrant.Text + "','" + txtAgntCntctName.Text + "','" + txtAgntPhone.Text +
"','" + txtAgntEmail.Text + "','" + txtAwardDate.Text + "','" + txtFYFund.Text + "','" + txtAgreementDate.Text + "','" + txtExpireDate.Text
+ "','" + txtFSR1.Text + "','" + txtFSR1Sub.Text + "','" + txtFSR2.Text + "','" + txtFSR2Sub.Text + "','" + txtFSR3.Text + "','" + txtFSR3Sub.Text
+ "','" + txtFSR4.Text + "','" + txtFSR4Sub.Text + "','" + rtxReportComments.Text + "','" + txtFiscDead.Text + "','" + txtCouncApp.Text + "','"
+ txtGrantCode.Text + "','" + txtGrantDetail.Text + "','" + txtBudget.Text + "','" + txtFundcode.Text + "','" + txtIndexCode.Text + "','"
+ txtRevenue.Text + "','" + txt1stQtr.Text + "','" + txt2ndQtr.Text + "','" + txt3rdQtr.Text + "','" + txt4thQtr.Text + "','" + txtYearEnd.Text + "','" + rtxComments.Text + "');";
Edit: I just tried placing [] around all column names, no success.
Comment