System.Data.OleDb.OleDbException:'条件表达式中的数据类型不匹配。' VB。净

时间:2019-06-11 19:38:09

标签: vb.net winforms

Imports System.Data.OleDb
Public Class Form1
    Dim con As New OleDbConnection
    Dim sql As String
    Dim cmd As OleDbCommand
    Dim odr As OleDbDataReader
    Dim dt As New DataTable
    Dim ds As New DataSet
    Dim da As OleDbDataAdapter

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\e_alq\OneDrive\Desktop\a3\test.mdb"
    End Sub

       Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        con.Open()
        da = New OleDbDataAdapter("Select * from test where basicsalary > 1  ", con)
        ds.Tables.Add(dt)
        DataGridView1.DataSource = dt.DefaultView
        da.Fill(dt)
        ds.Tables.Clear()
        con.Close()
    End Sub

    Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click

    End Sub
End Class

0 个答案:

没有答案