Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
1. sqlconnection con = new sqlconnection();
2. con.connectionstring="connection string text";
3. string query="select *from dbo.names";
4. sqlcommand cmd = new sqlcommand(quey,con);
5. sqldatareader dr = cmd.excutereader();
i am confused in line 5 where dr has the refrence to the method executereader() of the sqlcommand class.what is actually happening there when i am calling the read() of the sqldatareader class,can someone give me a detailed explanation on this.i am pretty new to c# and ado.net so i am a bit confused..pllz help.