2. Create an object of SqlConnection class as follows.
SqlConnection connection = new
3. Create an object of SQLCommand class as follows and assign query and Connection to it as follows.
SqlCommandcmd = new SqlCommand(“Select *
from Employee” , connection);
4. Create and initialize SqlDataAdatper and pass command object to it.
SqlDataAdapter da = new SqlDataAdapter(cmd);
5. Create and initialize datatable object which will store your records set
6. Use the fill method of Adapter class to fire the query and store the resulset in the datatable created in above step.
7. Now you can use this datable and bind it to grid or can do other things.