I cant believe it... it worked! thanks! adding a parametized statement
did the trick!

Sub Submit_Search(ByVal obj As System.Object, ByVal e As
System.EventArgs) Handles btn_submit.Click
 'This function gets the part number entered by the user and finds it
in the database, and returns the data for this part number.

 'Link to database
     Using myConnection As New MySqlConnection("server=localhost; user
id=myuser; database=database1; pooling=false;")

      'Find the matching part number
      Using sqlComm_search As New MySqlCommand("SELECT part_no,
cust_part_no, customer FROM table1 WHERE part_...@part_no",
myConnection)
        sqlComm_search.Parameters.AddWithValue("@part_no",
search_part_no.Text)
      myConnection.Open()
          Using sqlRead As MySqlDataReader =
sqlComm_search.ExecuteReader()
          sqlRead.Read()

       'Display the row of data
      End Using
    End Using
 myConnection.Close
 End Using

end sub


Now I can start doing some stuff from my database! =)

Reply via email to