Input from text box as text(not number) and by button click need all values from the sql table to be viewed in the datagridview.
eg:deptname as input in textbox, and by button click take all values from table matching this deptname and get output in datagridview.
Can anyone help me out in this matching of textbox value as text of mine.As its matching integer type but text type is not getting matched.

SELECT * FROM TableName WHERE ColumnName like '%" & textBox1.Text & "%'
commented: got it +1

Hello i've tried this,but still i'm not getting the output...:-(...
Can u suggest some other solutions??

show your code and what the effort of that.

Thankuu its working now...i was leaving space between ' &"..
thankuu..i was trying to solve this from past many days..but couldn't solve...now i could with ur help...:-)

you're welcome sainiricha.
don't forget to mark this thread solved.
happy coding friend :)