我是编码新手。边学边学习,我只想用结帐为null的行填充数据网格
我希望特定数据显示在我的数据网格中,其中不包含任何签出值。我不知道我在做什么错。我是vb新手。
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
provider = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
datafile = "D:\Projects\ezchain\ezchain\data\ex.accdb"
connec = provider & datafile
mycon.ConnectionString = connec
mycon.Open()
Dim str As String
str = "SELECT * from Keys WHERE checkout = '' "
Dim cmd As OleDbCommand = New OleDbCommand(str, mycon)
Try
cmd.ExecuteNonQuery()
cmd.Dispose()
mycon.Close()
Catch ex As Exception
MsgBox("Error")
mycon.Close()
Me.KeysTableAdapter.Fill(Me.ExDataSet.keys)
End Try
Me.KeysTableAdapter.Fill(Me.ExDataSet.keys)
End Sub
自动取款机什么都没有弹出,甚至没有异常... o.O