1
Reply

Preselect a multi simple listbox from a datareader

b_moorjani

b_moorjani

Feb 24 2005 7:03 PM
1.8k
Hey guys an absolute new c# developer I can't figure this out so please help this.sqlConnection1.Open (); SqlDataReader dr; dr = this.cmdselected.ExecuteReader(); while (dr.Read()) { if( Convert.ToInt32(dr["SupplierId"]) == 3) { int indexnew = this.listBox1.Items.IndexOf (dr["ProductName"]); this.listBox1.SetSelected (indexnew,true); } } dr.Close (); this.sqlConnection1.Close();

Answers (1)