0

hello..

m developing web application ..in it m going to use RadioButtonList control...

well.. problem is want to get value for RadioButtonList control from databse..

here is ma code..

this is aspx code file..

< asp:RadioButtonList ID="RadioButtonList1" runat="server" 
            RepeatDirection="Horizontal">
            <asp:ListItem>Web</asp:ListItem>
            <asp:ListItem>DeskTop</asp:ListItem>
        </asp:RadioButtonList>

this is aspx.cs code file

protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                strcon.Open();

                OleDbCommand cmd = new OleDbCommand("select webapp from TestData", strcon);
                cmd.CommandType = CommandType.Text;

                  OleDbDataReader reader = cmd.ExecuteReader();

              while (reader.Read())
                {
                     RadioButtonList1 .SelectedValue = reader ["webapp"].ToString ();

              }
           strcon.Close();
            }
        }

here i had used access databse as primary ...

in tht thr is table named TestData with webapp field...

while reading data from databse it does not give any result..


i had also tried to bind RadioButtonList control with databse bt the list items doesn't thr...only giving true & false..

tell me whr m going wrong?

thanks ...

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by krazyk
0

ok..

What else to do?..

its not giving me the result..

thanks in advance...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.