我有这些代码行,我试图查看我的数据库以获取 soundex 结果,但显然它没有返回任何结果。
con.Open()
Try
Dim query As String
query = "SELECT * FROM table_name WHERE column_name LIKE CONCAT('" & "%" & "',SOUNDEX('" & input & "'),'" & "%" & "')"
cmd = New MySqlCommand(query, con)
adapter.SelectCommand = cmd
reader = cmd.ExecuteReader
Dim list As New ListViewItem
While reader.Read()
list = ListView1.Items.Add(dr(1).ToString())
list.SubItems.Add(dr(2).ToString())
End While
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
con.Close()
它甚至不会在 MessageBox 上引发异常。
为了确保在我进行上述查询之前从我的数据库返回数据,我做了select * from table_name
。
谢谢!