asp.net OleDbCommand 的用法
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間:2020-11-27 22:45:05
asp.net OleDbCommand 的用法
asp.net OleDbCommand 的用法: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(); OleDbConnec
導(dǎo)讀asp.net OleDbCommand 的用法: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(); OleDbConnec

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();
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
asp.net OleDbCommand 的用法
asp.net OleDbCommand 的用法: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(); OleDbConnec