I changed my code to:

    Using myDA As New MySqlDataAdapter(str_search, myConnection)
      myDA.SelectCommand.Parameters.AddWithValue("input_part_no",
"partno2")
      Using myDataSet As New Dataset()
          myDA.Fill(myDataset, "table1")
          MySQLDataGrid.DataSource = myDataSet.Tables("table1")
          MySQLDataGrid.DataBind()
        End Using
     End Using

It still does not work. The 2nd line of code above shows me hardcoding
a value, partno2, into the variable input_part_no.
I know that partno2 exists in the database, but its not finding it.
Maybe input_part_no is not taking on the value (partno2) that I give
it?

Once again, if I do not use parametized statements, and use this line
of code instead:
         Dim str_search = New String("SELECT part_no, cust_part_no,
customer FROM table1 WHERE part_no LIKE '%partno2%'")
The right data is found. However, I don't want to hardcode, because I
want to be able to search from the database, whatever the user enters
into the search box.

Any help appreciated.

Helvin

Reply via email to