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

How can you identify whether or not any changes are made to the DataSet object since it was last loaded?

764


What is a string variable?

646


How would you connect to database using .NET?

769


What is ado in agriculture?

680


What are the different methods available under the sqlcommand class to access the data?

768


What is the purpose of using adodb?

686


What is a datareader object?

800


What is ole used for?

680


What DataReader class do in ADO.NET ?

774


List all the steps in order, to access a database through ado.net?

795


What are the difference between readonly vs. Const?

674


What is Data view?

766


What is the difference between Optimistic and Pessimistic locking?

737


What is executequery?

681


How do you implement locking concept for dataset?

732