HawaiiDragon
asked on
List Box double populating
I have a new one for you guys...
I have a list box that is populated via a stored procedure .... Now here is the wierd thing my list box is being double populated... that is if I have only two names in my database where the reader is reading from i.e. Adams and Zach it is printing them ouit twice adams zach adams zach...
its like the method is being called twice...
does anyone know how to stop it from doing that???
Matt
I have a list box that is populated via a stored procedure .... Now here is the wierd thing my list box is being double populated... that is if I have only two names in my database where the reader is reading from i.e. Adams and Zach it is printing them ouit twice adams zach adams zach...
its like the method is being called twice...
does anyone know how to stop it from doing that???
Matt
SqlConnection con = new SqlConnection(Settings.GetConfigValue("PARK_IRB_V1_11_19_2010", "IRB2010ConnectionString"));
con.Open();
SqlCommand cmd = new SqlCommand("P_sp_PopulateNewFactSup", con);
SqlDataReader r = cmd.ExecuteReader();
DataTable dt = new DataTable();
while (r.Read())
{
ListItem i = new ListItem(r["truename"].ToString().Trim(), r["ParkID"].ToString().Trim());
LBFactSupNew.Items.Add(i);
}
con.Close();
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
SqlConnection con = new SqlConnection(Settings.Get
con.Open();
SqlCommand cmd = new SqlCommand("P_sp_PopulateN
SqlDataReader r = cmd.ExecuteReader();
DataTable dt = new DataTable();
LBFactSupNew.Items.Clear()
while (r.Read())
{
ListItem i = new ListItem(r["truename"].ToS
LBFactSupNew.Items.Add(i);
}
con.Close();