开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜