Unanswered Contains in linqtoSql query

  • Thursday, February 07, 2013 6:55 PM
     
     

    Hi,

    Can anyone let me know this one.I am using linqtosql query in the query i am using contains..it is failing..below is my query

    var records = _context.RatedCallRecords.Where(a => a.MobileNumber.contains(phoneNumber) && a.DialedDigits != null && a.EventTime.Value.Date >= StartDate && a.EventTime.Value.Date <= EndDate).OrderBy(a => a.EventTime);

    I have few PhoneNumbers which start with different codes..so i just want to ignore those and check if the phone# contains the given number then show results?

    Thanks!


    rr

All Replies

  • Thursday, February 07, 2013 6:58 PM
    Moderator
     
     
    What is the error message you're receiving and can you run SQL Server Profiler to see which SQL query the above translates into? I think the error may be related with incompatible types (say, something is integer vs. varchar).

    For every expert, there is an equal and opposite expert. - Becker's Law


    My blog