|
| | 9 A' g0 [- w5 Q8 H- s
往ACCESS 添加数据
3 K K' d( M4 X- \6 T& `& n" ?* O( x0 J5 n% 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+"')"; ! q5 I# ^: L1 @- _
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
4 [: {2 m: l. R$ X$ b OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
6 q5 e9 w; t. ^$ xmycommand.Connection.Open();
; n1 D! h% U$ N4 r0 F7 \" Y9 vmycommand.ExecuteNonQuery(); ) ~4 Z) N7 v* E8 J! ]
mycommand.Connection.Close();
( |: ]8 I# V' g0 w0 @* XResponse.Write("<script language=Javascript>alert('注册成功')</script>"); 0 `8 ]* f) N/ v5 b' o$ O
# ?5 c: {8 V4 r# y" m, A7 D! `
" a" `+ B2 c. g# g A
老是说INSERT INTO 语句的语法错误 ! R" `% m1 m5 @
检查了N变都没发现哪里错(C#的) ! a) | O6 w4 U7 Y9 m9 ~
|
|
|
|