Hi guys!
I'm getting frustrated with my code because my filter in my query is not working.
All of the item_model in my receiving_details table were being suggested in auto complete but as you can see in my query that I'm filtering item model with a certain form_no.
Please help me.. Thank you.
Private Sub item_suggest()
Try
SQLconn = New SqlConnection
SQLconn.ConnectionString =
"server=TOSOT_IT\TOSOT_SERVER;user=sa;password=cblls7890;database=TOSOT_DATABASE;"
SQLconn.Open()
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim da As New SqlDataAdapter(" SELECT item_model FROM receiving_details WHERE form_no= '" & txtFROM_NO.Text & "' ", SQLconn)
da.Fill(dt)
Dim r As DataRow
txtITEM_MODEL.AutoCompleteCustomSource.Clear()
For Each r In dt.Rows
txtITEM_MODEL.AutoCompleteCustomSource.Add(r.Item(0).ToString)
Next
SQLconn.Close()
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Sub