1029hxl 发表于 2008-6-4 13:25:28

请大虾帮忙


往ACCESS 添加数据

string aaa="insert into zhuce(a_name,a_pwd,a_apwd,a_e-mail,a_tel) values('"+TextBox1.Text+",'"+TextBox2.Text+"','"+TextBox3.Text+"','"+TextBox4.Text+"','"+TextBox5.Text+"')";
OleDbConnection myconnection= new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
            OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
mycommand.Connection.Open();
mycommand.ExecuteNonQuery();
mycommand.Connection.Close();
Response.Write("<script language=Javascript>alert('注册成功')</script>");


老是说INSERT INTO 语句的语法错误
检查了N变都没发现哪里错(C#的)
页: [1]
查看完整版本: 请大虾帮忙