>Hi everybody,
>
>I have the following VFP code which I want to convert into LINQ to DataTable query
>
>
> do case
> case llCheckType=.t. and llCheckCat=.t.
> lcWhereCond="((type=2 and lsn_cat="+.VFP2SQL(csrDCIInfo.lsn_cat)+;
> ") or (type=3 and lessontype="+.VFP2SQL(csrDCIInfo.lessontype)+"))"
> case llCheckCat=.t.
> lcWhereCond="type=2 and lsn_cat="+.VFP2SQL(csrDCIInfo.lsn_cat)
> otherwise
> lcWhereCond="type=3 and lessontype="+.VFP2SQL(csrDCIInfo.lessontype)
> endcase
> select *;
> from csrMax4Sale;
> into cursor csrDCILimits NOFILTER;
> where start_time < ltEndTime and end_time > ltStartTime and &lcWhereCond
>
>So, I found a few links on creating LINQ to datatable such as
http://forums.asp.net/t/1150810.aspx for example.
>
>My problem right now that I need to make different queries depending on my conditions.
>
>So, I was thinking of
>
>if (condition 1)
> var query = ....
>else
> if (condition 2)
> var query = ...
>
>
>So, I somehow need to declare this query variable at the top to be able to re-use it. But this is a problem - I don't know how to declare it with the type. What this var query should be so I can use it in my code?
>
>Thanks a lot in advance.
No ideas?
If it's not broken, fix it until it is.
My Blog