dualshck012
Active member
I would like to know the workaround to get the datarow from the selected control (combobox) in a group of controls(combobox) from the flowlayoutpanel and pass the value to a variable
Here is the code for the adding of controls based from the database. I tried using via messagebox to test the datarow ID's retrieved by each created controls.
Here is the code for the adding of controls based from the database. I tried using via messagebox to test the datarow ID's retrieved by each created controls.
C#:
private void RetreiveAllpriorityRequest()
{
string query210A = "select statdesc, jorstatID from ihsasstat where statactv = 'A' ";
mysqlconstring.conn2.Open();
mysqlconstring.cmda = mysqlconstring.conn2.CreateCommand();
mysqlconstring.cmda.CommandType = CommandType.Text;
mysqlconstring.cmda.CommandText = query210A;
mysqlconstring.cmda.ExecuteNonQuery();
mysqlconstring.adapta.SelectCommand = mysqlconstring.cmda;
mysqlconstring.adapta.Fill(mysqlconstring.table3);
foreach (DataRow DatRow in mysqlconstring.table3.Rows)
{
CheckBox chk = new CheckBox();
chk.Width = 240;
chk.FlatStyle = FlatStyle.Flat;
//font here
chk.Text = DatRow["statdesc"].ToString();
//chk.CheckedChanged += new EventHandler(CheckBox_Checked);
Jor_icts_prior_flw_pnel.AutoSize = true;
Jor_icts_prior_flw_pnel.Controls.Add(chk);
//MessageBox.Show(DatRow["jorstatID"].ToString());
}
mysqlconstring.conn2.Close();
}