在插入数据的时候提示insert into 语法错误,帮我看看错在哪里,我使用的是Access数据库,谢谢
protected void btn_submit_Click(object sender, EventArgs e)
{
string CnnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("lmyfback.mdb");
OleDbConnection con = new OleDbConnection(CnnString);
con.Open();
string sex = "0";
string jiameng = "0";
string net = "0";
string paper = "0";
string friend = "0";
string qita1 = "0";
string shop = "0";
string select = "0";
string market = "0";
string tese = "0";
string pin = "0";
string tixi = "0";
string qita2 = "0";
string fx = "0";
string fy = "0";
string tj = "0";
string noneTS = "0";
string qj = "0";
string yx = "0";
string qita3 = "0";
if(this.rbtn_man.Checked)
{
sex = "男";
}
if(this.rbtn_woman.Checked)
{
sex = "女";
}
if(this.ckb_jm.Checked)
{
jiameng = "1";
}
if(this.ckb_net.Checked)
{
net = "1";
}
if(this.ckb_paper.Checked)
{
paper = "1";
}
if (this.ckb_friend.Checked)
{
friend = "1";
}
if (this.ckb_qita1.Checked)
{
qita1 = "1";
}
if(this.rbtn_yes.Checked)
{
shop = "1";
}
if(this.rbtn_none.Checked)
{
shop = "0";
}
if(this.rbtn_shi.Checked)
{
select = "1";
}
if(this.rbtn_fou.Checked)
{
select = "2";
}
if(this.rbtn_kl.Checked)
{
select = "3";
}
if(this.ckb_market.Checked)
{
market = "1";
}
if(this.ckb_tese.Checked)
{
tese = "1";
}
if(this.ckb_pin.Checked)
{
pin = "1";
}
if(this.ckb_tixi.Checked)
{
tixi = "1";
}
if(this.ckb_qita2.Checked)
{
qita2 = "1";
}
if(this.ckb_fx.Checked)
{
fx = "1";
}
if(this.ckb_fy.Checked)
{
fy = "1";
}
if(this.ckb_tj.Checked)
{
tj = "1";
}
if(this.ckb_noneTS.Checked)
{
noneTS = "1";
}
if(this.ckb_qj.Checked)
{
qj = "1";
}
if(this.ckb_yx.Checked)
{
yx = "1";
}
if(this.ckb_qita3.Checked)
{
qita3 = "1";
}
OleDbCommand cmd = new OleDbCommand("insert into lmyfback([name],[sex],[job],[jiguan],[tel],[email],[jiameng],[net],[paper],[friend],[qita1],[invest],[area],[shop],[mj],[impress],[select],[market],[tese],[pin],[tixi],[qita2],[fx],[fy],[tj],[noneTS],[qj],[yx],[qita3],[yj]) values('" + this.tbx_name.Text.Trim() + "','" + sex + "','" + this.tbx_job.Text.Trim() + "','" + this.tbx_jiguan.Text.Trim() + "','" + this.tbx_tel.Text.Trim() + "','" + this.tbx_email.Text.Trim() + "','" + jiameng + "','" + net + "','" + paper + "','" + friend + "','" + qita1 + "','" + this.tbx_invest.Text.Trim() + "','" + this.tbx_area.Text.Trim() + "','" + shop + "','" + this.tbx_mj.Text.Trim() + "','" + this.tbx_impress.Text.Trim() + "','" + select + "','" + market + "','" + tese + "','" + pin + "','" + tixi + "','" + qita2 + "','" + fx + "','" + fy + "','" + tj + "','" + noneTS + "','" + qj +"','" + yx + "','" + qita3 + "','" + this.tbx_yj.Text.Trim() + "'", con);
try
{
cmd.ExecuteNonQuery();
Response.Write("<script>window.alert('加盟申请提交成功,谢谢您的支持!');</script>");
}
catch (Exception ex)
{
Response.Write(ex.Message);
//Response.Write("<script>window.alert('加盟申请提交失败,请稍后再试...');</script>");
}
finally
{
con.Close();
}
}