Answered C# 2010 linq to sql question

  • Sunday, January 27, 2013 5:22 AM
     
     

    In a C# 2010 application, I am trying to use the following linq to
    sql statment. However I am getting an error message on the select statement listed below.

    eDataContext eData = new eRPTDataContext();

    var eRPTRVWRun = eData.Client_Schedules.Where(c => c.Review_month == selMonth && c.Review_year == selYear).Select(c => c.Review_id).FirstOrDefault();

    Thus can you tell me what I can change so that select statement in the linq to sql builds clean?

All Replies

  • Sunday, January 27, 2013 7:10 AM
     
     Answered

    try this

    eDataContext eData = new eDataContext();

    var eRPTRVWRun = eData.Client_Schedules.Where(c => c.Review_month == selMonth && c.Review_year == selYear).Select(c => c.Review_id).FirstOrDefault();

    if still having issue show us error detail.............


    Abdul Jabbar

  • Sunday, January 27, 2013 3:50 PM
     
     

    Hi Wendy;

    Can you please post the exact exception message and inner exception message so that we can understand what is happening.

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".