dynamicquery - Concatinate Variable define in Dynamic Query

I'm building a dynamic query. Inside it, I have declare variables. Now I want to concatenate this variable in my insert querydeclare @qry nvarchar(MAX)select @qry='Declare @var1 nvarchar(10); set @var1 =''abcd''insert into mytable (col1) values ('+@var1+')'When I execute this code it give me an error Must declare the scalar variable "@var1".But if I declare @var1 outside @qry then it works fine.I am having problem in concatenating the value of variable.Please helpThanks...Read more

dynamicquery - To call SelectMany dynamically in the way of System.Linq.Dynamic

In System.Linq.Dynamic, there are a few methods to form Select, Where and other Linq statements dynamically. But there is no for SelectMany.The method for Select is as the following: public static IQueryable Select(this IQueryable source, string selector, params object[] values) { if (source == null) throw new ArgumentNullException("source"); if (selector == null) throw new ArgumentNullException("selector"); LambdaExpression lambda = DynamicExpression.ParseLambda(source.ElementType, null, selector, values); IQu...Read more