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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:16:46+00:00 2026-05-20T05:16:46+00:00

how do I used date on searching using Linq. I think I’m missing something

  • 0

how do I used date on searching using Linq. I think I’m missing something on the declaration

string searchName = Request.Form["PersonName"];
DateTime searchDateFrom = Request.Form["ReceivedDateFrom"];
DateTime searchDateTo = Request.Form["ReceivedDateTo"];

var Results = (from va in _db.myTable
       where ((va.PersonName.Contains(searchName)
               && (va.ApplicationReceivedDate > searchDateFrom 
                   && va.ApplicationReceivedDate < searchDateTo)
               select va).ToList();
  • 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-20T05:16:46+00:00Added an answer on May 20, 2026 at 5:16 am

    HttpRequest.Form is a NameValueCollection, where you can get strings in it by int/string indexer. That is, Request.Form["ReceivedDateFrom"] returns a string, you can’t assign it to a variable whose type is DateTime without any convert. You can try DateTime.ParseExact method to convert the string to a DateTime. But if you can’t guarantee the string has a correct format, you can use a TryParse method.

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

Sidebar

Related Questions

My form contains a textbox for date input. When submitted the data is used
my date of string like (2009-12-03 21:05:00) date with time . so i used
how to format 2011-10-25T13:00:00Z string into date and time i used simple date format
I am using windows 7 (32 bit) and firefox 8. When I used date(d
I used Date() for getting the date of my birthday, but it was returned
I used a new Date() object to fill a field in a MySQL DB,
I've used the localtime function in Perl to get the current date and time
Does anybody know which date format is to be used, trying to create a
How can you insert the date in the filename (a dynamic filename) used in
I used the LINQ to SQL designer in Visual Studio to create an object

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.