L
Lasse Edsvik
Hello
I've created a class that has a method that returns a dataset like this:
public DataSet GetAllCustomers()
{
Open();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("CustListAll", dbconn);
da.Fill(ds);
return ds;
}
Then I added a new project and then tried to do this:
public Form1()
{
InitializeComponent();
Northwind n = new Northwind();
listBox1.DataSource = n.GetAllCustomers();
listBox1.DisplayMember = "CustomerName";
listBox1.Text = "CustomerName";
}
When I run it only has a text
"System.Data.DataViewManagerListItemType.Descriptor" in it
errrm? what to do here to get it to show in listbox?
/Lasse
I've created a class that has a method that returns a dataset like this:
public DataSet GetAllCustomers()
{
Open();
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter();
da.SelectCommand = new SqlCommand("CustListAll", dbconn);
da.Fill(ds);
return ds;
}
Then I added a new project and then tried to do this:
public Form1()
{
InitializeComponent();
Northwind n = new Northwind();
listBox1.DataSource = n.GetAllCustomers();
listBox1.DisplayMember = "CustomerName";
listBox1.Text = "CustomerName";
}
When I run it only has a text
"System.Data.DataViewManagerListItemType.Descriptor" in it
errrm? what to do here to get it to show in listbox?
/Lasse