EDN Admin
Well-known member
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
Hi Experts,
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
My Name is Somnath .I am working ASP.net Project in which I am using Linq
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
I am creating Dynamic Lamabada Expression using Expression tree following
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
<span style="color:#333333; font-family:Arial,Helvetica,sans-serif; font-size:13px; line-height:16px I have
<pre class="prettyprint lstReport=lstReport.Where(o=> <span style="text-decoration:underline DateTime.Parse(o.Field) ==DateTime.Parse(o.FieldValue));
//I am creating above statement dynamically like this
var variable = Expression.Variable(typeof(Report));
foreach (SQWFilterConstraint oFC in oFilter.LstFilterConstraint) //usingthis collection I am making dynamic query
{
Expression ExprLeft =Expression.Property(variable, oFC.Field);
MethodInfo methodDateTimeParse = typeof(DateTime).GetMethod("Parse", newType[] { typeof(string) });
var methodParam = Expression.Parameter(typeof(string), oFC.FieldValue);
Expression exprRight = Expression.Call(methodDateTimeParse, methodParam ); //This is working fine for right side
}
var props = new[] { variable };
var lambda = Expression.Lambda<Func<Report, bool>>(ExprPrev, props).Compile();
ReportList = ReportList.Where(lambda).ToList();[/code]
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
So Need to apply DateTime.Parse method on filed also which comes at the left side (which is underlined and bold above left side of the operator)
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
I will be very thank full if you provide help.
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
Thanks in Advance ,
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
Somnath
View the full article
Hi Experts,
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
My Name is Somnath .I am working ASP.net Project in which I am using Linq
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
I am creating Dynamic Lamabada Expression using Expression tree following
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
<span style="color:#333333; font-family:Arial,Helvetica,sans-serif; font-size:13px; line-height:16px I have
<pre class="prettyprint lstReport=lstReport.Where(o=> <span style="text-decoration:underline DateTime.Parse(o.Field) ==DateTime.Parse(o.FieldValue));
//I am creating above statement dynamically like this
var variable = Expression.Variable(typeof(Report));
foreach (SQWFilterConstraint oFC in oFilter.LstFilterConstraint) //usingthis collection I am making dynamic query
{
Expression ExprLeft =Expression.Property(variable, oFC.Field);
MethodInfo methodDateTimeParse = typeof(DateTime).GetMethod("Parse", newType[] { typeof(string) });
var methodParam = Expression.Parameter(typeof(string), oFC.FieldValue);
Expression exprRight = Expression.Call(methodDateTimeParse, methodParam ); //This is working fine for right side
}
var props = new[] { variable };
var lambda = Expression.Lambda<Func<Report, bool>>(ExprPrev, props).Compile();
ReportList = ReportList.Where(lambda).ToList();[/code]
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
So Need to apply DateTime.Parse method on filed also which comes at the left side (which is underlined and bold above left side of the operator)
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
I will be very thank full if you provide help.
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
Thanks in Advance ,
<p style="margin-bottom:1.2em; padding-right:0px; border-right-width:0px; border-bottom-width:0px; border-left-width:0px; border-style:initial; border-color:initial; outline-width:0px; outline-style:initial; outline-color:initial; font-size:13px; vertical-align:baseline; width:542px; color:#333333; font-family:Arial,Helvetica,sans-serif; line-height:16px
Somnath
View the full article