|
| | ; \- j5 C( @) i" D6 l
往ACCESS 添加数据
" q7 \' P/ {: U( g! A$ ~. v' @# f" a
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+"')"; 7 s" T5 [, f! J
OleDbConnection myconnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+Server.MapPath("db1.mdb"));
% V1 w& h i/ r/ l9 R+ K) x OleDbCommand mycommand = new OleDbCommand(aaa,myconnection); 3 Z ^& ?4 W y) K
mycommand.Connection.Open();
& t* |$ N( ]1 p2 A% zmycommand.ExecuteNonQuery(); 1 ^$ h" J! E1 [( N. ?( P1 D1 v
mycommand.Connection.Close(); & h5 X( u& F6 u! J
Response.Write("<script language=Javascript>alert('注册成功')</script>");
5 N7 @2 I! s4 N
0 v9 ]+ j2 H6 [4 U) B+ v
3 e- n6 T4 K9 |老是说INSERT INTO 语句的语法错误 ; ]4 f: y( k1 L# G( r x
检查了N变都没发现哪里错(C#的) 7 e; \; ?$ a1 r$ L6 q
|
|
|
|