query string not working right
I've got this string:
VB Code:
SQLCMD.CommandText = "select usoc_code, usoc_description " & _
"from features " & _
"WHERE telephone_number = '" & RemoveHyphen(telephone) & "' " & _
"and (usoc_code = 'eamntc' or " & _
"usoc_code = 'ramntc' or " & _
"usoc_code = 'ranmntc' or " & _
"usoc_code = 'bamntc' or " & _
"usoc_code = 'baiw' or " & _
"usoc_code = 'banmntc') "
I can run that in Query Analyzer and it works BUT when used in my app, the dataReader doesn't get populated meaning (to me) the query doesn't pass any of the 'or's' . One thing to note is that when I take out the or's, I get back data.
is there something wrong with the syntax or is there a limitation to a datareader I don't know about?
also, the data in the reader is going to the statement here:
VB Code:
reader = SQLCMD.ExecuteReader
reader.Read()
While reader.Read
MainForm.Ticketing.tab_0_lstMaintOptions.Items.Add(reader.Item("usoc_code") & " - " & reader.Item("usoc_description"))
End While
MainForm.Ticketing.tab_0_lstMaintOptions.Update()