selectionList and datareader problem - Please Help!!

D

domchik

I have a selectionList control bounded to a DataReader on a mobile
form like this :


cboStreetsSpecific.DataSource = drStreets;
cboStreetsSpecific.DataTextField ="StreetName";
cboStreetsSpecific.DataValueField ="StreetID";
cboStreetsSpecific.DataBind();




When I press a Command button and do Postback , I would like to
retrieve the selected item's text and value. I've tried to do it
inside Command_onClick event like this

private void cmdContinue_Click(object sender, System.EventArgs e)
{

string str= cboStreetsSpecific.Items[cboStreetsSpecific.SelectedIndex].Value);
}

or like this :

private void cmdContinue_Click(object sender, System.EventArgs e)
{

string str= cboStreetsSpecific.Selection.Value;
}


but it doesn't work. I also tried to retrieve it through Request
object like this :

string str= request.form["cboStreetsSpecific"].ToString();



and it doesn't work either .

When I do the same actions when the selectionList filled without
DataReader all the above attempts to retrieve the selected value DO
WORK !

Please , tell me how can I get the selected value when the
selectionList is bounded to datareader .

Thanks a lot in advance !!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top