开发者

How to convert IEnumerable<table> to xml or dataset

开发者 https://www.devze.com 2022-12-17 16:46 出处:网络
This is the code: IEnumerable<table> results = db_dane.ExecuteQuery<table>开发者_Python百科(query);

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

精彩评论

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