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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:54:37+00:00 2026-05-27T07:54:37+00:00

Login authentication on my website is based on three parameters of which one is

  • 0

Login authentication on my website is based on three parameters of which one is date of birth. A DatePicker is provided to the user to select the Date. The format in which the date is saved in Database is MM/dd/yyyy.

When is check for the authentication the Linq query is not returning any result as the record in Database is in MM/dd/yyyy and the value passed from the view to the controller is in dd/mm/yyyy.Hence im not getting any output.

Below is my code of what I’m doing in controller.

[HttpPost]
        public ActionResult Login(LoginTable log)
        {
            var login = from a in db.LoginTables
                        where a.DOB== log.DOB
                        select a;
        }

Also I have tried

var login = from a in db.LoginTables
                            where a.DOB== log.DOB.toString("MM/dd/yyyy")
                            select a;

but its giving error (No Overload method ‘ToString()’ takes 1 argument)

What can i do?

  • 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-27T07:54:38+00:00Added an answer on May 27, 2026 at 7:54 am

    The reason this is failing is because the LINQ is translated into SQL syntax and there is no equivalent of ToString in SQL.

    Given that log is a parameter to your method why not simply have:

    [HttpPost]
    public ActionResult Login(LoginTable log)
    {
        string DOBString = log.DOB.ToString("MM/dd/yyyy");
    
        var login = from a in db.LoginTables
                    where a.DOB == DOBString
                    select a;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our SSO login process uses Forms Authentication against a custom user store in SQL
i'm using forms based authentication within my aspnet (c#) website. At the log in
I have a two factor based authentication server which i need to integrate to
I have a database which has form authentication tables for an website [let say
I need to scrape from a website that requires authentication, that is a user
I'm writing a login system for a website, but when the user gets the
Our website runs on ASP.NET v4 and users log in user Forms authentication. We
Goal: User tries to access page without authentication. Site redirects to login page, when
i added windows authentication on my website to track user names. For IE it
I am trying to let GoogleBot login to my website and bypass the authentication.

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.