当前位置:   article > 正文

VB.NET 三种读SQL数据库命令实例二OLEDB_vbnet oledb 实例

vbnet oledb 实例
Dim   myCon   As   New   OleDbConnection
          Dim   ds   As   New   DataSet
          Dim   mycmd   As   New   OleDbCommand
          Dim   myada   As   New   OleDbDataAdapter
        myCon.ConnectionString = ConfigurationManager.ConnectionStrings( "wb2012ConnectionString" ).ToString()
        myCon.Open()
          Dim   dsql   As   String   =   "delete from wbInventory where wb_cInvCode='"   + DataGridView1.CurrentRow.Cells(2).Value.ToString() +   "'"
          Dim   scmd   As   New   OleDbCommand(dsql, myCon)
        scmd.ExecuteNonQuery()
        MsgBox( " 成功删除! " )
          Dim   sql   As   String   =   "Select top 500 * from wbInventory order by addtime desc"
        myada =   New   OleDbDataAdapter(sql, myCon)
        myada.Fill(ds)
        DataGridView1.DataSource = ds.Tables(0)
        myCon.Close()
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/203334
推荐阅读
相关标签
  

闽ICP备14008679号