Author: phamster | Posted on: 4/30/2010 4:40:34 PM | Views : 541

Hey guys,
I'm having trouble binding my listbox. Can someone see what's wrong with my code? When I run the page it doesn't populate anything.
String strConn = ConfigurationManager.ConnectionStrings["passwordKeeperConnectionString"].ConnectionString; SqlConnection connection = new SqlConnection(strConn); connection.Open(); SqlDataAdapter myDataAdapter; DataSet ds; myDataAdapter = new SqlDataAdapter("SELECT * FROM details", connection); ds = new DataSet(); myDataAdapter.Fill(ds); foreach(DataRow dr in ds.Tables[0].Rows) { lstBoxCategory.Items.Add(dr["webResourceTitle"].ToString()); }
 
...

Go to the complete details ...