views:

54

answers:

2

Hello.

This is the code:

IEnumerable<table> results = db_dane.ExecuteQuery<table>(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?

A: 

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.

bryanjonker
A: 

That is easy way, but i preffer use some function or something like that. That's why asked question here.

Anyway, thanks.

Pawel