Question bindingsource problems

Agila

New member
Joined
Jul 4, 2011
Messages
2
Programming Experience
1-3
Hi!
I'm a new bie and I need some informations to do my project. From webservice I get mye data as a List and this is stored in my application in bindingsource.datasource. The list do have many properties which displays as columns in the datagrid successfully
But my problem is how do I store the data in my local memory? You might say just make some local dataset or datatable....,but how do I convert the list to datatable? Or how do I convert bindingsource.datasource to datatable?:confused::confused: I'm confused. I would appreciate If anyone could explain me this with some
sample code.
Thanks
Agila
 
But my problem is how do I store the data in my local memory?
You are already storing the list in local memory, this happened when you received the data from the service.
 
You are already storing the list in local memory, this happened when you received the data from the service.

Yes, but if I turn of the program, everything is lost. Therefor I want to store the received list in my local memory, maybe dataset or sql database? And then I have problems to convert list to dataset or datatable. I would appreciate if some one could give me a samplecode to solve this problem.

Thanks

Agila
 
Saving a list of string to a file:
IO.File.WriteAllLines("file.txt", list.ToArray)
 
how do I convert the list to datatable?
Create a DataTable, add a DataColumn for each property of the items in the List, loop through the List and, for each item, create a DataRow, assign the appropriate item property value to the appropriate field of the row, then add the row to the table.
 
Back
Top