Hi Narmatha,
Call the command object which specifies to your requirement.Then bind the dataset or data reader to the gridview.
Example:
SqlCommand cmd=new SqlCommand("select * from emp where salary<500",cn);
SqlCommand cmd=new SqlCommand("select * from emp where salary>=500 and salary<=1000",cn);
I Hope it helps you,
If any more problems, send me a query.