DAL:
string str = "select * from Employee where Id=" + e.eID + "";
SqlCommand cmd = new SqlCommand(str, con);
DataTable dt = new DataTable();
SqlDataAdapter adp = new SqlDataAdapter();
adp.SelectCommand = cmd;
adp.Fill(dt);
string[] s = new string[] { };
if (dt.Rows.Count >= 0)
{
//e.eHobbies = dt.Rows[0]["Hobbies"].ToString(); //checkboxlist
e.eGender = dt.Rows[0]["Gender"].ToString(); //radiobutton
e.eName = dt.Rows[0]["Name"].ToString(); //Textbox
e.eMobile = dt.Rows[0]["Mobile"].ToString(); //Textbox
e.eCity = dt.Rows[0]["City"].ToString(); dropdownlist
e.eEmail = dt.Rows[0]["Email"].ToString(); //Textbox
}
con.Close();
return dt;
Here I have Issue about query that which query can I use for getting values from SQL to checkbox list. I want to checked the items which is already stored in database but i have confusion about query as well as code that how to get all things properly. Hobbies are belongs to CheckboxList. As well as I want to select radiobutton from database.
Thanks in Advance


Jignesh KumarRank #91 · 22.9K reputationPosted Dec 26, 2018, 10:34 PM EST
Kinjal Sonachhatra83 reputationPosted Dec 27, 2018, 10:17 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Dec 27, 2018, 10:27 PM EST
Kinjal Sonachhatra83 reputationPosted Jan 1, 2019, 4:53 PM EST
Jignesh KumarRank #91 · 22.9K reputationPosted Jan 1, 2019, 5:12 PM EST
Laxmidhar SahooRank #383 · 6.6K reputationPosted Jan 1, 2019, 7:24 PM EST