|
| | ' l' o0 u: b* ~. l( b9 d3 b
往ACCESS 添加数据- r9 c, m7 ?% S$ H
* n3 F- }! R6 O( t4 ]& {& z
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+"')";
: L3 i( H- @; c0 l/ eOleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb")); * l4 d" o" E8 `' Z) M9 S2 }" b' O
OleDbCommand mycommand = new OleDbCommand(aaa,myconnection);
: W' V4 H3 M) W- x0 ^; Q1 `0 `5 ?mycommand.Connection.Open();
- D9 Z- j% ?! f |& _8 `mycommand.ExecuteNonQuery();
U/ f/ v% ^# P! ~mycommand.Connection.Close(); 7 I. |+ Z# a# t- a
Response.Write("<script language=Javascript>alert('注册成功')</script>"); & o9 ]5 d( i+ o, r2 u) k
$ j, r! G0 @4 K# B+ v7 @
, R6 X2 }9 s4 D老是说INSERT INTO 语句的语法错误 2 s! m8 r5 S4 Z; X
检查了N变都没发现哪里错(C#的) 5 h: d3 h" {. E9 q
|
|
|
|