c# - Search From Textbox and highlight GridView according session in Asp.net -
hey guys trying search textbox text changed evet , highlight gridview using session ..
i have tables in database in rows showroomid, customer_name , pendriveno there. showroom id showrrom login have stored session["user"]
.
i want when search textbox ,i want particular sessions data should displayed if login showroom id 'hero' row data should displayed on searching text box .
i have tried code
protected void textbox1_textchanged(object sender, eventargs e) { sqlconnection con1 = new sqlconnection(configurationmanager.connectionstrings["connectionstring"].connectionstring); sqlcommand cmd1; sqldataadapter da1; dataset ds1; cmd1 = new sqlcommand("select * tblshowroom showroomid='"+session["users"]+"' , customer_name like'" + textbox1.text + "%' or pendriveno like'" + textbox1.text + "%'", con1); da1 = new sqldataadapter(cmd1); ds1 = new dataset(); da1.fill(ds1); gridview1.datasource = ds1; gridview1.databind(); }
but thing not happenning . **when log in @ time session works show session["users"]
data , on text box search showing data
thanks in advance .....
Comments
Post a Comment