|
| |
1 R5 L- L+ n/ P' i$ ?1 I. T往ACCESS 添加数据' N: r2 o% c, `
$ C; @3 t! V- C9 w8 u
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+"')"; + F$ I8 I0 g, s
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb")); " v# g% N7 B' U% I/ C9 Q# W. A7 l- U
OleDbCommand mycommand = new OleDbCommand(aaa,myconnection); " g1 L x) f! p4 T( [* b* l- I
mycommand.Connection.Open(); 4 {! G6 b$ G- E4 P8 u
mycommand.ExecuteNonQuery();
: e& Y& v% C @) n4 umycommand.Connection.Close();
) z5 {9 c$ @$ t5 c6 ~5 qResponse.Write("<script language=Javascript>alert('注册成功')</script>");
7 W) K9 A9 {) P0 M$ u
* U, z! D8 _7 O9 E0 L' \- D' f/ v& h% J4 i! K0 L
老是说INSERT INTO 语句的语法错误 ( d( h; [' k. F! ^% A& v$ N2 w
检查了N变都没发现哪里错(C#的) ! t n3 q6 [/ L1 l2 h8 \! O
|
|
|
|