|
7 R( n/ l; O( n. s- T; J6 g- q往ACCESS 添加数据
# m \5 r1 P h) }' m7 n
6 t0 G0 {, B6 {( {. [2 Ostring 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+"')"; 0 w+ Y5 C& B! F$ z
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
0 i q1 Q# {: C OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
6 _% y& `/ ^' j, e, b/ @mycommand.Connection.Open(); & w# F, X6 t- y4 g( b% Y
mycommand.ExecuteNonQuery();
2 y- I- K& l- E3 v8 e* P8 Jmycommand.Connection.Close();
: Y) `/ {$ m+ l, _' u) y8 gResponse.Write("<script language=Javascript>alert('注册成功')</script>"); 2 b1 X. Z1 A3 m7 i- d+ ^' V
; L* U, |4 ?8 [: O, D
( k( R8 N, }. M" K6 I老是说INSERT INTO 语句的语法错误
3 m4 s- @& F6 J- ~; Y8 |检查了N变都没发现哪里错(C#的) 5 I0 ~2 I( U- K# F% A
|
|