How to convert IEnumerable<table> to xml or dataset
This is the code:
IEnumerable<table> results = db_dane.ExecuteQuery<table>开发者_Python百科(query);
- table - is a database table,
- query - sql query (example: select * from table),
- db_dane - linq datacontext.
How to convert results of this query to xml or dataset?
My best thought is to convert it to a List through ToList(), and then looping through that to convert it to a data table.
http://ayende.com/Blog/archive/2007/05/09/Converting-an-object-collection-to-a-DataSet.aspx
Messy, but should work.
精彩评论