Can someone please help me to create a functun which will allow to dynamically filter the grid view

example: if the user wants to search a employee with different fields how to create a dynamic fiter

situation 1 filter by only one colum eg employee id
situation sort with 3 fields, number, name and department id


how do i make the query build dynamicly

Code for the first situation,

select * from TableName where EmployeeId=@parameter1

Code fot the second situation,

select number, name and department id
 from TableName order by number.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.