我先尝试使用此代码,然后再将其复制到我的主项目中(我创建了新项目以便首先测试代码):
upsert
在我的示例项目中,这是有效的。但是当我将它复制到我的主项目并运行时,我收到了这个错误:Private Sub posBtn_Click(sender As Object, e As EventArgs) Handles posBtn.Click
On Error GoTo wewe
If posText.Text = "" Then
Call notFound()
Exit Sub
Else
Dim cantFind As String = posText.Text
EmployeesRecordBindingSource.Filter = "(Convert(#_of_Employees, 'System.String') LIKE '" & posText.Text & "')" & "OR (last_name LIKE '" & posText.Text & "') OR (first_name LIKE '" & posText.Text & "')" & "OR (mi LIKE '" & posText.Text & "') OR (position LIKE '" & posText.Text & "')"
If EmployeesRecordBindingSource.Count <> 0 Then
With DataGridView2
.DataSource = EmployeesRecordBindingSource
End With
Else
MsgBox(cantFind & vbNewLine & "The search item was not found!", MsgBoxStyle.Information, "Hey boss")
EmployeesRecordBindingSource.Filter = Nothing
With DataGridView2
.ClearSelection()
.DataSource = EmployeesRecordBindingSource
End With
End If
End If
lul:
Exit Sub
wewe:
MsgBox("Error Number " & Err.Number & vbNewLine & "Error Description " & Err.Description, MsgBoxStyle.Critical, "Reset Error!")
Resume lul
End Sub
等等......我错过了什么?顺便说一句,它是用于在datagridview中搜索。我还有私人子重置,没发现。
答案 0 :(得分:1)
字段不能以#
开头,因为它用于日期。
在您的平台和数据库中创建signs
和numbers
时,您可能会重新考虑使用fields
和variables
,因为有可能保留这些内容。