LINQ newbie question

B

balint kardos

Hi all,

My question is about parsing and saving a LINQ query from/to xml.
I'm creating an web interface where a user can select fields from dataset
tables, and create relations between them (think about creating a sql
report); I would like to save and reload the query, and I'm trying to
implement it as a LINQ query.
Is there any way to do this?

Thanks,

Balint
 
N

Nicholas Paldino [.NET/C# MVP]

Balint,

There isn't really any way to do this, since the IEnumerable
implementations returned by the LINQ libraries are not marked as
serializable in any way.

You would have to manually serialize the query.

You might want to serialize the parts of the query in other forms (not
the actual elements in .NET, but the concept of the query, like which
fields, the where clause, the sort order) and then construct the query later
dynamically.
 
B

balint kardos

Hi Nicholas,

thank you for your answer, I'll try to implement it.

b.

Nicholas Paldino said:
Balint,

There isn't really any way to do this, since the IEnumerable
implementations returned by the LINQ libraries are not marked as
serializable in any way.

You would have to manually serialize the query.

You might want to serialize the parts of the query in other forms (not
the actual elements in .NET, but the concept of the query, like which
fields, the where clause, the sort order) and then construct the query
later dynamically.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

balint kardos said:
Hi all,

My question is about parsing and saving a LINQ query from/to xml.
I'm creating an web interface where a user can select fields from dataset
tables, and create relations between them (think about creating a sql
report); I would like to save and reload the query, and I'm trying to
implement it as a LINQ query.
Is there any way to do this?

Thanks,

Balint
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top