OleDbConnection conn=new OleDbConnection();
conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=e:\\db.mdb";
string sql=""insert into db (id,user) values('"+TextBox2.Text.Replace("'","''")+"','"+TextBox1.Text.Replace("'","''")+"');
OleDbCommand comm=new OleDbCommand(sql,conn);
conn.Open();
comm.ExecuteNonQuery();
conn.Close();
[此贴子已经被作者于2006-3-11 16:00:21编辑过]