I retrieved my data from table and put it in a label. Now I want for each row to generate a checkbox. How can I do that? so..
option1..checkbox1
option2..checkbox2....
This is my code for obtaining the data:
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["erp"].ConnectionString);
con.Open();
string intero = "Select * from judete";
SqlCommand cmd = new SqlCommand(intero, con);
SqlDataReader rdr;
rdr = cmd.ExecuteReader();
while (rdr.Read())
{
Label1.Text +=rdr[0] + "" + rdr[1] + "<br/>";
}
rdr.Close();
con.Close();
I’m using C# in an asp.net web application
Answer for your second question
Add this code in your previous code
And then create a new method like this