vb.net - unable to get that data from sql to display in textbox what's wrong with the code? -


i want input data textbox1 (ex: nsb1000-pcp) , when click textbox2 want display corresponding value of pcp pentax.
unable data sql display in textbox2.

what's wrong code?
(pcp = abbrev; pentax = comp)

dim conn sqlconnection     dim adapter new sqldataadapter     dim connecting string     dim reader sqldatareader      connecting = "data source = erik\sqlexpress; integrated security = true; database = nsb1"     conn = new sqlconnection(connecting)     dim text1 string = textbox1.text     dim words() string     dim separator() string = {"-"}     words = text1.split(separator, stringsplitoptions.removeemptyentries)      try         conn.open()         dim query string = words(1)                    query = "select comp list abbrev = '" & textbox1.text & "' "         command = new sqlcommand(query, conn)         reader = command.executereader         dim dt new datatable         while reader.read             textbox2.text = reader("comp")         end while         conn.close()     catch ex exception      end try 


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -