I saved radiobutton value in database like "A4Size" or "A5Size".Now i want to retrieve that data from database to radiobutton.If A4Size in database i want to check the Radionbutton (A4Size) value other wise uncheck the radiobutton (A5Size) value.
Code Like this
private void BillLoad()
{
DataTable dt = new DataTable();
con.Open();
SqlDataReader myReader = null;
SqlCommand myCommand = new SqlCommand("select * from Bill ", con);
myReader = myCommand.ExecuteReader();
while (myReader.Read())
{
if (myReader["ReportSize"].ToString() == "A4_Size")
{
ChhkA4.Checked = true;
}
else
{
ChhkA5.Checked = true;
}
}
con.Close();
}