zell71
asked on
populate a dataset from a list
hi guys,
i have a list with a number of strings..
i wish to display those values on on a datagridview.
what method shall i use?im struggling to pass the string list to a dataset.
thanks
i have a list with a number of strings..
i wish to display those values on on a datagridview.
what method shall i use?im struggling to pass the string list to a dataset.
thanks
// code i've got so far
clsListClass myFileToSend;
clsDataBase cls = new clsDataBase();
myFileToSend = cls.GetData(No);
foreach (string myString in myFileToSend.Names)
{
}
You don't need to create a DataSet, in order to bind a list of objects to a DataGridView. Your objects just need to have public properties which you can specify in the column's DataPropertyName.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does that work, or is that what you were using that has problems? Did you define columns for the DataGridView, and set the DataSource property to 'dsTable'?
ASKER
I created a dataset with a datatable and passed my list values into that dataset.my question was to ask how I did but I found the answer