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

  • Home
  • SEARCH
  • 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 6033577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:30:11+00:00 2026-05-23T05:30:11+00:00

I’m having a strange problem with SQL Server 2008, in which some datetime variables

  • 0

I’m having a strange problem with SQL Server 2008, in which some datetime variables within stored procedures are getting incorrect values (1754-01-01). Here is the background/context of the situation:

I’m working on an ASP.NET web application using the SqlMembershipProvider class. I use the out-of-box functionality for storing user data in the database, validating usernames/passwords, etc. Our application also has a custom e-signature implementation that requires authenticating the user with some additional information (mother’s maiden name, graduation year, etc.).

I do this authentication in two steps: first, I call Membership.ValidateUser(username, password) to do all the basic checks. If that succeeds, then I call a custom stored procedure to do the additional authentication. If this additional authentication fails, I would like to update the aspnet_Membership database table to record the failure — so that the user can get locked out after 3 failed authentication attempts in the same way that failed logins are handled in Membership.ValidateUser.

I did some research and determined that the Membership.ValidateUser method records failed logins and locks out the user account by calling the aspnet_Membership_UpdateUserInfo stored procedure. So I decided to just call this stored procedure from within my custom authentication stored procedure as needed, in order to increment the FailedPasswordAttemptCount column, IsLockedOut, etc.

The problem is that when I invoke this stored procedure directly, the stored procedure is unable to retrieve the correct datetime value (FailedPasswordAttemptWindowStart) from the aspnet_Membership table in order to correctly increment the FailedPasswordAttemptCount. The UpdateUserInfo stored procedure declares a local variable and does a select statement to retrieve this datetime value from the membership table into the local varable. The datetime value it retrieves is always 1754-01-01 00:00:00.000, regardless of what value is stored in the table.

I am trying to figure out why I cannot retrieve the correct datetime value from this database table within this stored procedure. Here is what I have tried:

Incorrect datetime value is retrieved when:

  • invoke aspnet_Membership_UpdateUserInfo from my custom stored procedure, which in turn is invoked from C# using Linq to SQL
  • invoke aspnet_Membership_UpdateUserInfo directly from my application using Linq to SQL
  • invoke a custom stored procedure that has the same code as UpdateUserInfo from my stored procedure, or directly from C#

Correct datetime value is retrieved when:

  • Invoking aspnet_Membership_UpdateUserInfo directly from SQL Server Management Studio
  • Invoking my custom stored procedure directly from SSMS, which in turn invokes aspnet_Membership_UpdateUserInfo
  • aspnet_Membership_UpdateUserInfo is invoked via the Membership.ValidateUser method

Has anyone seen a problem like this, where a stored procedure selects a value of 1754-01-01 from a db table instead of the correct value? I’d really like to have an understanding of why this is happening, but would be open to a workaround to somehow avoid this issue entirely. All I really need is a way to track failed username+password and failed custom authentication attempts in the same way, so that the user gets locked out after too many failures.

Thanks!

  • 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-23T05:30:12+00:00Added an answer on May 23, 2026 at 5:30 am

    Marking as answered. I was using Membership.ValidateUser to do the initial check of the user’s password, etc., and then immediately after that calling my stored procedure to do the initial authentication checks and the subsequent UpdateUserInfo call. When testing the use case of “correct password, incorrect additional authentication info”, I forgot that the initial ValidateUser call ends up resetting the FailedPasswordAttemptCount and FailedPassswordAttemptWindowStart values in the database. So the datetime values really were correctly being set to 1754-01-01, the stored procedure I was calling was not retrieving incorrect data.

    I fixed this by removing my call to ValidateUser for the special authentication scenario, and instead manually hashed the user’s password and sent that to my custom stored procedure, so that all the authentication took place in one step with one subsequent call to the UpdateUserInfo procedure.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a text area in my form which accepts all possible characters from

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.