Link to home
Start Free TrialLog in
Avatar of zell71
zell71Flag for United Kingdom of Great Britain and Northern Ireland

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
// code i've got so far
                clsListClass myFileToSend;
                clsDataBase cls = new clsDataBase();
                myFileToSend = cls.GetData(No);                
 
                foreach (string myString in myFileToSend.Names)
                {                    
                    
                }

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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
Avatar of zell71
zell71
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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'?
Avatar of zell71

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