Can we bind one datareader wid two dropdown list?
Answers were Sorted based on User's Feedback
Answer / pradip humane
Yes,we can bind the one datareader with two dropdownlist.
because datareader just read the data and forward the
data,that's why there is no problem for binding with two
dropdown list with one reader
Is This Answer Correct ? | 16 Yes | 4 No |
Answer / 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 |
Answer / ak
It is simple
if(reader.hasrows)
{
combo1.additem(reader[0])
combo2.additem(reader[1])
}
Is This Answer Correct ? | 2 Yes | 2 No |
Answer / rmishra
We can bind the same Datareader to different drop downs but
the constraint is that it will show the same data for both
the dropdown ie if the datareader fetches the city data for
one dropdown then it will show the same data for second one
Is This Answer Correct ? | 2 Yes | 4 No |
Answer / vivek
data reader has no multiple binding because when it is
binded to multiple controls navigation problem
araises.because it is forward only.
so,multiple binding is perfectly possible with dataset only
Is This Answer Correct ? | 0 Yes | 4 No |
Explain the dataadapter class in ado.net?
What is the return type of executescalar?
what is different between SqlCommand object and Command Behaviour Object
What are the different layers of ado.net?
What is the difference between connected and disconnected environment?
What is dao and ado?
What is ado rdo dao in visual basic?
What is defaultview in datatable?
I loaded the dataset with a table of 10 records. One of the records is deleted from the backend, How do you check whether all the 10 records were present while updating the data(Which event and steps) and throw the exception.
2 Answers Fulcrum Logic, Satyam,
What is dataset and datatable in ado.net?
Is bulk insert faster than insert?
what purpose of Indexing creating? directly we can search the reqired row with the help of query?what is the use of indexing?