A
Ant
Hi,
I'm trying to populate a list box using a dataset. The data set is tested
fine to have data in it but when I run the app, the listbox does not get
populated. Below is what I'm doing:
Class1 myclass = new Class1();
myclass.Server = "LAPTOP";
myclass.DB = "Northwind";
DataSet ds = myclass.ReturnDS();
ListBox1.DataSource = ds.Tables[0];
ListBox1.DataTextField = "CustomerID";
ListBox1.DataBind();
// works ok, returns field so Dataset contains data
Page.Response.Write(ds.Tables[0].Rows[0][0].ToString();
Why doesn't this work?
Many thanks for any ideas in advance
Ant
I'm trying to populate a list box using a dataset. The data set is tested
fine to have data in it but when I run the app, the listbox does not get
populated. Below is what I'm doing:
Class1 myclass = new Class1();
myclass.Server = "LAPTOP";
myclass.DB = "Northwind";
DataSet ds = myclass.ReturnDS();
ListBox1.DataSource = ds.Tables[0];
ListBox1.DataTextField = "CustomerID";
ListBox1.DataBind();
// works ok, returns field so Dataset contains data
Page.Response.Write(ds.Tables[0].Rows[0][0].ToString();
Why doesn't this work?
Many thanks for any ideas in advance
Ant