myconn.Open() Dim command As New SqlCommand("Select * from Food where Food List = @list", myconn) command.Parameters.Add("@list", SqlDbType.VarChar).Value = txtbox1.Text Dim adapter As New SqlDataAdapter(command)

Dim table As New DataTable() adapter.Fill(table)

the error i get will show at the adapter.fill(table) saying i have non boolean type at(Food List) how do i fix this any idea?beginner at vb

  • 1
    Hey man, this is a little hard to understand what you are asking. Would you be able to clean it up a bit? – Anthony Genovese Apr 14 at 13:27
  • Show us SQL and not VB(?) code! Extract the SQL string and post that here - along with the table defintions (AS DDL, i.e. CREATE TABLE foo (...);). There are some articles on how to ask questions here on my profile - you might want to take a look? p.s. welcome to the forum! – Vérace Apr 14 at 13:35
  • 1
    you have a space between food and list.. try put it between [ ] – Dominique Boucher Apr 14 at 13:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.