The following lines are supposed to display to a text box the phones numbers that match the condition in the sql statement, however it shows me all the phone numbers:
I feel like this line is the problem but I am not sure if I am missing something:Code:Dim SQL As String = "SELECT *, Phone FROM TblContacts WHERE '" & Event_query & Condition & Abs_value & "'" Dim myOleDbCommand As New OleDb.OleDbCommand(SQL, con) con.Open() Using myDataReader As OleDb.OleDbDataReader = myOleDbCommand.ExecuteReader() If myDataReader.Read() Then While myDataReader.Read() ' txtPhone.Text = numbers.Text += myDataReader.Item("Phone").ToString + vbCrLf notfound = 0 End While
Help would be much appreciatedCode:numbers.Text += myDataReader.Item("Phone").ToString + vbCrLf




Reply With Quote