OleDbConnection con=new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; data source=data.mdb”); con.Open(); OleDbCommand dc=new OleDbCommand(“select name from us where id=2”, con); textBox1.Text=dc.ExecuteScalar().ToString();
OleDbConnection con=new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; data source=data.mdb”); con.Open(); OleDbCommand dc=new OleDbCommand(“insert into us (name) values (11)”, con); dc.ExecuteNonQuery(); con.Close();
string us=textBox2.Text; string pa=textBox1.Text; OleDbConnection con=new OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0; data source=data.mdb”); OleDbCommand oldC=new OleDbCommand(“insert into users (username, userpassword) values (@username, @userpassword)”, con); oldC.Parameters.Add(“@username”, us); oldC.Parameters.Add(“@userpassword”, pa); con.Open(); oldC.ExecuteNonQuery(); con.Close(); MessageBox.Show(“Register successful!”); this.Dispose();
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/36162.html