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 8505631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:22:32+00:00 2026-06-11T02:22:32+00:00

got a exception when exec the query in LinqPad var allNewsInADay= (from t in

  • 0

got a exception when exec the query in LinqPad

var allNewsInADay= (from t in Tnews where t.SendTime.Value.Year==2012 && 
    t.SendTime.Value.Month==8  && t.SendTime.Value.Day==20 select t);
allNewsInADay.Dump();

Exception: The member access ‘System.DateTime Value’ is not supported

if use .HasValue property: NotSupportedException: The member access 'Boolean HasValue' is not supported

—
i use MySql
and my purpose is to get all records in a specific day.

  • 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-06-11T02:22:34+00:00Added an answer on June 11, 2026 at 2:22 am
    var rslt= (from t in Tnews 
               where t.SendTime.HasValue 
                  && t.SendTime.Value.Year==2012 
                  && t.SendTime.Value.Month==8  
                  && t.SendTime.Value.Day==20 
               select t);
    

    or

    var someDate = new DateTime(2012,8,20);
    var rslt= (from t in Tnews 
               where t.SendTime.HasValue  
                  && t.SendTime.Value.Date==someDate 
               select t);
    

    will help?

    upd: you tried bad. just ran this:

    class Program
    {
        public class TNews
        {
            public DateTime? SendTime { get; set; }
            public string Id;
        }
        static void Main(string[] args)
        {
            var tnews = new TNews[]
            {
                new TNews { SendTime = new DateTime(2012,8,20), Id="2012-08-20" },
                new TNews { SendTime = new DateTime(2012,8,20,12,20,0), Id="2012-08-20 12:20" },
                new TNews { SendTime = new DateTime(2012,8,21), Id="2012-08-21" },
                new TNews { SendTime = null, Id="null" },
            };
    
            var someDate = new DateTime(2012, 8, 20);
            var rslt = (from t in tnews
                        where t.SendTime.HasValue 
                           && t.SendTime.Value.Date == someDate
                        select t);
    
            foreach (var t in rslt)
            {
                Console.WriteLine(t.Id);
            }
        }
    }
    

    output is:

    2012-08-20
    2012-08-20 12:20
    Press any key to continue . . .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got exception about convert NULL to Int32. I've got a table from database
I got the below Exception when i wnat to get the data from another
i've got exception, while running java class from Eclipse: java.util.MissingResourceException: Can't find bundle for
I got exception when I try to publish action to facebook. Exception : {error:{message:(#3502)
I am using following datatype in my database . but I got exception as
ive got this exception. My Object looks like this: @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ObjectDTO
I got this exception ... EntityCategoryProxy could not be converted to int in ...
I am using Hibernate and got the exception ArrayIndexOutOfBoundsException. What are the possible causes?
When i run the command below: 127.0.0.1:8080/solr/suggest?spellcheck.build=true I got an exception as below, anyone
I got a strange exception when trying to find out if a property in

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.