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()