|
| | ) X- C6 y5 Y# t
往ACCESS 添加数据7 j$ ?+ x/ t% N! V; [( G; F
4 f/ F! o1 u, \1 R" f4 E
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+"')"; 7 ?! h2 ?" s ~
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
' i- d6 P* \- X; H( m OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
. e, H# }+ A# z5 X; ~mycommand.Connection.Open();
/ }9 R ]( d! \& X" E# Omycommand.ExecuteNonQuery();
2 \& v5 R$ B9 v4 L! o) X8 y% pmycommand.Connection.Close();
2 N3 ^& v" p3 l0 k+ eResponse.Write("<script language=Javascript>alert('注册成功')</script>"); 4 A. X/ s) E5 }' ^+ o" v" q9 `
( X2 F0 \, c" t: x8 T) i( t4 f; [; Y& q2 _- j- e- i" F
老是说INSERT INTO 语句的语法错误 * p& r' v6 \% G7 G: X5 L) }( Q1 W$ N
检查了N变都没发现哪里错(C#的)
/ I' L* s! m- P: s% t4 n6 \9 N |
|
|
|