|
| | 1 G2 r7 X9 \4 i3 n6 U9 O/ g! t
往ACCESS 添加数据; a E" `- T( a: \
# q: u+ a: V2 [
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+"')";
8 N2 N- V% A8 n+ ^OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
+ w' h( S( Q' p/ [) A2 I OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
* S% j( }7 v8 O; xmycommand.Connection.Open();
" P1 A+ A$ F# {2 ]( s D# L/ Y; }; kmycommand.ExecuteNonQuery(); - l m& L# Q( {% E1 p( p' C. r
mycommand.Connection.Close();
5 e2 ]4 c; G% S% \# A8 f& KResponse.Write("<script language=Javascript>alert('注册成功')</script>"); 2 h# f: Y6 w9 n6 \, \ \
2 j, @* d# A" t8 y# E! z
& q/ e3 A3 t1 W! g H# D) ?老是说INSERT INTO 语句的语法错误
& S, l$ w) g6 A, Q% O# J% F4 o检查了N变都没发现哪里错(C#的)
; f& F5 [. S! J |
|
|
|