|
| | # {# [# ^. a& p% l0 b9 ~
往ACCESS 添加数据
+ b) B( T! r* X! T5 C% z `* |7 W- y
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+"')"; ( h+ V( t6 e1 P4 V, @8 f% C
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb")); / c0 h9 [9 \( `3 S3 s
OleDbCommand mycommand = new OleDbCommand(aaa,myconnection); / S5 r. U& v, F$ A P. \3 X/ T6 b
mycommand.Connection.Open(); 4 X0 p' Y. ?: F. J0 \, I2 P
mycommand.ExecuteNonQuery(); " p* [7 y# `3 e( \$ K6 r* `. L. f
mycommand.Connection.Close(); # T, C% X. `3 ?% _5 w% k3 Z
Response.Write("<script language=Javascript>alert('注册成功')</script>"); 5 M; U) N7 K8 D& q. r! W# d- ]
& x/ T7 [; C, ]' T
, Y U4 _; M0 y1 c* |老是说INSERT INTO 语句的语法错误 1 ?6 m0 x J; W. p
检查了N变都没发现哪里错(C#的)
' e+ F% Q1 Q! G |
|
|
|