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 ...