display data in dropdownlist

Posted by Klbaiju under ASP.NET on 3/31/2012 | Points: 10 | Views : 1815 | Status : [Member] | Replies : 4
Hi,
in my application
i populated a datareader from database
and dropdown contains 4 values

my datareader has the value of second

suppose dropdown contains 3 values such as active,not active ,maintanence

i tried this
dropdown.selectedvalue=dr.getstring(6);
showing errors
i want to display this value in dropdownlist
how it is possible.

Regards

Baiju




Responses

Posted by: Avdesh on: 3/31/2012 [Member] Starter | Points: 25

Up
0
Down
can u add your code here and what u asking tell me again bcoz it's not clear
thanks and regards
Avdesh

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 4/2/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

your Question is not clear can you please describe more about your problem?

R D Patel

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthi.Kamal66 on: 4/2/2012 [Member] Starter | Points: 25

Up
0
Down
HI

Can u add your code here..this question is not clear..


R.Karthikeyan

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 4/2/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi do one thing...

SqlDataReader dr = cmd.ExecuteReader();

if (dr.HasRows){
dr.Read();
dropdown.selectedvalue=dr.getstring(6);
}



Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Klbaiju, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response