I couldn't realize

I couldn't realize

Postby maxcpr » Thu 01 Jul 2010 14:26

Hi guys i am really couldn't realize why there is no way to get SQL request from DataContext if i only know ExpressionTree that describe this request!!!

Please somebody who understand or guess why it so give me suggestion.
maxcpr
 
Posts: 33
Joined: Wed 10 Dec 2008 14:46

Postby AndreyR » Mon 05 Jul 2010 14:34

Try the following code. expr is an Expression instance, context is a DataContext instance.
Code: Select all
      var query = Expression.Lambda(expr).Compile().DynamicInvoke();
      string s = context.GetCommand((IQueryable)query).CommandText;
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to LinqConnect (LINQ to SQL support)