使用文本框从 datagridview 中过滤名称和用户名

filter name and username from datagridview using textbox

我使用组合框作为选项搜索名称和用户名,使用文本框作为过滤器 有错误

缺少运算符

        Try
            If Trim(TextBox1.Text) <> "" Then

                dataadapter1 = New OleDbDataAdapter("select * form login where " & ComboBox2.Text & " like '%" & Trim$(TextBox1.Text) & "%'", conn)

                datasetaccounts.Clear()
                dataadapter1.Fill(datasetaccounts, "login")

                DataGridView1.DataSource = datasetaccounts
                DataGridView1.DataMember = "login"
                DataGridView1.Refresh()
            End If
        Catch ex As Exception
            MsgBox("Error !: " + ex.Message)
        End Try

应该是:

SELECT * FROM ...

而不是:

SELECT * FORM ...

所以与过滤或 ComboBoxesDataGridViews 或任何其他无关。这正是错误消息告诉您的内容:您的 SQL 代码中存在语法错误。