T
Thomas Scheiderich
I have 2 dropdowns that are exactly the same and I don't want to re-read
for each.
Is there a way to do something like below where I read the data, bind to
depCity1 and then bind to destCity2. I find that the second one always
is blank. I assume this is because the DataReader is read-forward only.
********************************************************
connect.open()
cmdSelect = New OleDbCommand("exec populateCities 'North America'",connect)
dtReader = cmdSelect.ExecuteReader()
depCity1.Datasource = dtReader
depCity1.DatatextField = "city_name"
depCity1.DataBind()
destCity2.Datasource = dtReader
destCity2.DatatextField = "city_name"
destCity2.DataBind()
connect.close()
********************************************
If I can't reuse the dtReader I already have, how do I quickly make
dest2City2 = depCity1?
Also, I have a stored procedure that doesn't pass back a title. Is
there a way to do the above where I do something like:
depCity1.DataTextField = dtReader(0).
I know the above isn't correct, just trying to find a way to say look at
column 0.
Thanks,
Tom.
for each.
Is there a way to do something like below where I read the data, bind to
depCity1 and then bind to destCity2. I find that the second one always
is blank. I assume this is because the DataReader is read-forward only.
********************************************************
connect.open()
cmdSelect = New OleDbCommand("exec populateCities 'North America'",connect)
dtReader = cmdSelect.ExecuteReader()
depCity1.Datasource = dtReader
depCity1.DatatextField = "city_name"
depCity1.DataBind()
destCity2.Datasource = dtReader
destCity2.DatatextField = "city_name"
destCity2.DataBind()
connect.close()
********************************************
If I can't reuse the dtReader I already have, how do I quickly make
dest2City2 = depCity1?
Also, I have a stored procedure that doesn't pass back a title. Is
there a way to do the above where I do something like:
depCity1.DataTextField = dtReader(0).
I know the above isn't correct, just trying to find a way to say look at
column 0.
Thanks,
Tom.