Page 1 of 1

How to get SQL clause from Expression

Posted: Wed 30 Jun 2010 09:51
by maxcpr
Hi.

Is it possible to get SQL clause from Expression (ExpressionTree)?

Problem is that i'm trying to use Expression to define condition in order to fill general DataTable by one. Since that i don't have DataContext and Queryable object (By the way, am i right? There is no way to cast System.DataTable to IQueriable?). And indeed i can't use DataContext.GetCommand(...) to achive my goal.

Posted: Thu 01 Jul 2010 16:01
by AndreyR
There is a way to cast System.DataTable to an IQueryable. Take a look at this LINQ to DataSet article.