Chuck P
4/3/2008 5:42:00 PM
Probably not worth the time.
My guess since it is a direct replacement that the LINQ interpreter has some
issues with embedding complex queries.
var qActiveJobDescriptions = from j in dc.Jobs
where DateTime.Today >= j.StartDate
&& (j.EndDate == null || (DateTime.Today <
j.EndDate.Value.AddDays(1)))
select j;
// var qActiveOracleJobCodes =from o in dc.OracleJobCodes
//where
// DateTime.Today >= o.DATEFROM
// && (o.DATETO == null ||
(DateTime.Today < o.DATETO.Value.AddDays(1)))
//select
o.JOBCODE).Contains(j.OracleJobCode;
GridView_Ex2.DataSource = (from j in qActiveJobDescriptions
where !(from o in dc.OracleJobCodes
where
DateTime.Today >= o.DATEFROM
&& (o.DATETO == null ||
(DateTime.Today < o.DATETO.Value.AddDays(1)))
select
o.JOBCODE).Contains(j.OracleJobCode)
select new { j.OracleJobCode })
.Join(dc.OracleJobCodes,aj =>
aj.OracleJobCode, or => or.JOBCODE,(aj, or) => new
{aj.OracleJobCode,or.JOBFAMILY,or.JOBTITLE}) ;
GridView_Ex2.DataBind();
""Wen Yuan Wang [MSFT]"" wrote:
> Hello Chuck,
> Thanks for your reply.
>
> It's really difficult to perform further research without exact error
> message. Your linq query looks fine. I cannot image why it failed after you
> replaced "from o in dc.OracleJobCodes....." with qActiveOracleJobCodes. It
> seems I need to reproduce the issue on my side. Could you please send me
> the reproduce steps?
> I'm willing to dig into the issue if you can send me a simple reproduce
> project and Database. My email address is v-wywang@microsoft.com.
>
> Please feel free to let me know if you have any more concern. We are glad
> to assist you.
> Have a great day,
> Best regards,
> Wen Yuan
>
> Microsoft Online Community Support
> Delighting our customers is our #1 priority. We welcome your comments and
> suggestions about how we can improve the support we provide to you. Please
> feel free to let my manager know what you think of the level of service
> provided. You can send feedback directly to my manager at:
> msdnmg@microsoft.com.
> ==================================================
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>