T
tshad
Is there a way to databind a datareader to 2 different dropdownlists?
Something like:
StoredSearches.DataSource=objCmd.ExecuteReader
StoredSearches.DataValueField="SearchID"
StoredSearches.DataTextField= "SearchName"
StoredSearches.databind()
SearchList.DataSource=objCmd.ExecuteReader
SearchList.DataValueField="SearchID"
SearchList.DataTextField= "SearchName"
SearchList.databind()
I can't do the above as the second Execute reader gives me an error saying I
have to close the reader first - which would mean a re-read.
I want to do this as I only want to read the database once but show 2
different dropdownlist (in different ways depending on how the user selects
the page).
If I can't do this, can I just do:
Searchlist = StoredSearches
Thanks,
Tom
Something like:
StoredSearches.DataSource=objCmd.ExecuteReader
StoredSearches.DataValueField="SearchID"
StoredSearches.DataTextField= "SearchName"
StoredSearches.databind()
SearchList.DataSource=objCmd.ExecuteReader
SearchList.DataValueField="SearchID"
SearchList.DataTextField= "SearchName"
SearchList.databind()
I can't do the above as the second Execute reader gives me an error saying I
have to close the reader first - which would mean a re-read.
I want to do this as I only want to read the database once but show 2
different dropdownlist (in different ways depending on how the user selects
the page).
If I can't do this, can I just do:
Searchlist = StoredSearches
Thanks,
Tom