我不知道为什么会出现此错误。它说转换字符串,但我认为它已经是字符串格式。这是什么解决方案?
Private Sub txtSearch_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtSearch.TextChanged
Dim DV As New DataView(dbDataSet)
DV.RowFilter = String.Format("emp_no Like '%{0}%'", txtSearch.Text)
DataGridView1.DataSource = DV
End Sub
答案 0 :(得分:0)
试试这个
Private Sub txtSearch_TextChanged(sender As System.Object, e As System.EventArgs) Handles txtSearch.TextChanged
Dim DV As New DataView(dbDataSet)
DV.RowFilter = String.Format("Convert(emp_no,'System.String') Like '%{0}%'", txtSearch.Text)
DataGridView1.DataSource = DV
End Sub