1
Answer

Preselect a multi simple listbox from a datareader

b_moorjani

b_moorjani

19y
1.8k
1
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)