Can we bind one datareader wid two dropdown list?

Answer Posted / anup kumar

yes, it is posible. by using NextResult() method of
sqldatareader.

sqlcommand cmd = new sqlcommand("select id from emp ; select
dptid from dpt",YourConnection);
//check connection status and open the connection
if(rdr.hasrows)
{
//read id from emp
}
if (rdr.HasRows() == true)
{
//read dptid from dpt
}
//close the connection

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Datareader and Dataset?

534


What are the advantages of ado.net?

503


What is an orm, and why would you use one instead of plain old ado.net?

562


Does executenonquery return a value?

529


How to add an aggregate column?

521






What are the rules to implement connection pooling?

497


What is the difference between executequery and executenonquery?

496


How to Read, Add, Update and Delete record in Entity Framework ?

557


How can we check that some changes have been made to dataset since it was loaded?

506


Which property is used to check whether a DataReader is closed or opened?

558


What is ado.net object model?

508


What are the data access namespaces in .NET?

618


What is ado.net in vb net?

489


Command objects uses, purposes and their methods.

508


What are the benefits of using ado.net?

509