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

前端之家收集整理的这篇文章主要介绍了VB.NET 三种读SQL数据库命令实例二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()
原文链接:https://www.f2er.com/vb/259494.html

猜你在找的VB相关文章