Srinivas Rao

Srinivas Rao

  • NA
  • 76
  • 17.1k

search bar in ASP.NET

Feb 25 2016 7:49 AM
hai  friends,
  these are the two textboxes  "EmpId" in Textbox1,and another for  "Employee name. in Textbox2"
so i want to search by "empid", by leaving second textbox as empty 
at the sametime if i left  "first textbox" as empty,and the second textbox with "Employee Name" . 
the data should appaer in the gridview.
 
i had written a query like this ,but iam not getting.
 
SelectCommand="SELECT [id], [EmpId], [FirstName], [MI], [LastName] FROM [Employees] WHERE ((EmpId like '%' +@EmpId + '%' or FirstName like '%' +@FirstName+'%' ))" 
 
pls reply, 
In advance
thanku 

Answers (2)