Hear Is the Code
strQuery = "SELECT code,name FROM tbl001 ORDER BY name";
orclDa =
new OracleDataAdapter(strQuery, strOrclConn);orclDa.Fill(orclDs, "tbl001");
clbMifalim.DataSource = orclDs.Tables["tbl001"];
clbMifalim.DisplayMember = "name";
clbMifalim.ValueMember = "code";
foreach
(int i in clbMifalim.CheckedIndices){
MessageBox.Show("Index#: " + i.ToString() + ", Value is:" +clbMifalim.SelectedValue + ".");
}
Thanks

Problem With CheckedListBox
M D Larsen
DataSet ds = new DataSet("HiHi");
ds.Tables.Add("Kings");
ds.Tables[0].Columns.Add("Name", System.Type.GetType("System.String"));
ds.Tables[0].Columns.Add("Id", System.Type.GetType("System.Int32"));
DataRow dr;
dr = ds.Tables[0].NewRow();
dr[0] = "AAA";
dr[1] = 1;
ds.Tables[0].Rows.Add(dr);
dr = ds.Tables[0].NewRow();
dr[0] = "BBB";
dr[1] = 2;
ds.Tables[0].Rows.Add(dr);
dr = ds.Tables[0].NewRow();
dr[0] = "CCC";
dr[1] = 3;
ds.Tables[0].Rows.Add(dr);
this.checkedListBox1.DataSource = ds.Tables[0];
this.checkedListBox1.DisplayMember = "Name";
this.checkedListBox1.ValueMember = "Id";
// following code is to read the selected items.
foreach(object obj in this.checkedListBox1.CheckedItems)
{
MessageBox.Show(((DataRowView) obj)[0].ToString() + ", " + ((DataRowView) obj)[1].ToString());
}
Regards,
Siva.M
vnpro
el_d
CheckedListBox.SelectedValue and .SelectedIndex contain the values for the last checked entry only. You can access the selected items through the CheckedItems and get the value for each item, or use CheckedIndices to index into the underlying dataset.
JanDV
selected items through the CheckedItems and get the value for each item
Regards,
boaz.