Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3481968
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:30:21+00:00 2026-05-18T10:30:21+00:00

I’ve got a timestamp column in SQL Server 2008. Now I need to query

  • 0

I’ve got a timestamp column in SQL Server 2008.

Now I need to query that column by using a date that picks up from a calendar server control.

We assume that I got a DateTime dt object;

I need to filter by this datetime object that returns all the records logged on that date(dt).

   var a = DateTime.Now.ToString();
   var IsDone = from d in _le.diets
                 where d.log_time.Contains(a)
                 select d.done;

_le is a private entity framework object.

This code has problem:

Error 3 ‘byte[]’ does not contain a
definition for ‘Contains’ and the best
extension method overload
‘System.Linq.ParallelEnumerable.Contains(System.Linq.ParallelQuery,
TSource)’ has some invalid
arguments f:\tests\diet\diet\DataTier\DietMovieRepository.cs 30 32 diet

Error 2 Cannot convert lambda
expression to type ‘string’ because it
is not a delegate
type f:\tests\diet\diet\DataTier\DietMovieRepository.cs 30 26 diet

Error 1 Delegate
‘System.Func’
does not take 1
arguments f:\tests\diet\diet\DataTier\DietMovieRepository.cs 30 26 diet

Error 4 Instance argument: cannot
convert from ‘byte[]’ to
‘System.Linq.ParallelQuery’ f:\tests\diet\diet\DataTier\DietMovieRepository.cs 30 32 diet

I’m a EF beginner, thanks for your help!

UPDATE

IN EF cs file

I see

   public static diet Creatediet(global::System.Int64 id, global::System.Boolean done, global::System.Byte[] log_time)
        {
            diet diet = new diet();
            diet.id = id;
            diet.done = done;
            diet.log_time = log_time;
            return diet;
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:30:21+00:00Added an answer on May 18, 2026 at 10:30 am

    A SQL Server “timestamp” has nothing to do with time (in fact the name “timestamp” is now marked deprecated; “rowversion” is identical and should be used instead).

    If you truly have a “timestamp” this is not possible. If you have a datetime set to the insertion time, it should be trivial:

    DateTime start = date.Date, end = start.AddDays(1);
    
    ...
    where row.log_time >= start && row.log_time < end
    ...
    

    Also, if you are mainly doing date-range searches, log_time may be a fair candidate for the clustered index. Or if you are doing day-based queries a non-clustered index on an integer that is the days-into-epoch would work too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.