M
moondaddy
Using c# 3.5, I'm trying to bind a data table to a combo box, but I cant see
any data in the list. I'm sure the data table has data. Here's my code:
DataSet ds = GetData();
DataTable tb = ds.Tables["tb"];
myCombo.DataContext = tb;
myCombo.DisplayMemberPath = tb.Columns["Name"].ToString();
myCombo.SelectedValuePath = tb.Columns["ID"].ToString();
any idea what I'm doing wrong?
any data in the list. I'm sure the data table has data. Here's my code:
DataSet ds = GetData();
DataTable tb = ds.Tables["tb"];
myCombo.DataContext = tb;
myCombo.DisplayMemberPath = tb.Columns["Name"].ToString();
myCombo.SelectedValuePath = tb.Columns["ID"].ToString();
any idea what I'm doing wrong?