,,asp.net OleDbCommand 的用法
ASP。网下OleDbCommand的使用代码
OleDbConnectioncon=newOleDbConnection(' Provider=Microsoft .杰特。OLEDB.4.0data source=data。MDB’);con . Open();oledbcommandc=newOleDbCommand(' selectnamefromuswhere id=2 ',con);文本框1。Text=dc .ExecuteScalar().ToString();
OleDbConnectioncon=newOleDbConnection(' Provider=Microsoft .杰特。OLEDB.4.0data source=data。MDB’);con . Open();oledbcommandc=newOleDbCommand(' insertintous(name)values(11)',con);华盛顿ExecuteNonQuery();con . Close();
stringus=textBox2 .文本;stringpa=textBox1 .文本;OleDbConnectioncon=newOleDbConnection(' Provider=Microsoft .杰特。OLEDB.4.0data source=data。MDB’);OleDbCommandoldC=newOleDbCommand(' insertintousers(username,userpassword)值(@username,@userpassword)',con);旧的.参数。添加(' @username ',us);旧的.参数。Add('@userpassword ',pa);con . Open();旧的.ExecuteNonQuery();con . Close();消息框.Show('Registersuccessful!');这个dispose();
郑重声明:本文由网友发布,不代表盛行IT的观点,版权归原作者所有,仅为传播更多信息之目的,如有侵权请联系,我们将第一时间修改或删除,多谢。