2
Answers

search bar in ASP.NET

Srinivas Rao

Srinivas Rao

8y
352
1
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)
Next Recommended Forum