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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:42:28+00:00 2026-06-10T08:42:28+00:00

I wish to use an SQL database that it already in use on my

  • 0

I wish to use an SQL database that it already in use on my network, so I have written code to override ValidateUser():

public override bool ValidateUser(string username, string password)
{
    return true;
}

I’ve set this so that it returns true, without checking my database for now, just to test the theory of it.

Is that all I need to do, or is there more to do so that it works properly with the other functions, like storing the username information so that it can be retrieved later on, or do I simply store this information in a session variable?

Once this function returns true, it the user effectively authenticated?

  • 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-10T08:42:30+00:00Added an answer on June 10, 2026 at 8:42 am

    You don’t need to override or implement all of the methods if you already inherit from SqlmembershipProvider.

    If you want to override ValidateUser (for example to log invalid login attempts), you don’t need to store the user manually(he’s stored in DB and identified via cookie) and can be retrieved by Membership.GetUser.

    For example:

    public override bool ValidateUser(string username, string password)
    {
        // check in database with SqlmembershipProvider
        bool isValid = base.ValidateUser(username, password);
        // get user from database
        var user = Membership.GetUser(username);
        if(isValid)
        {
            // ...
        }
        else{
            // log wrong attempt if you want
        }
        return isValid;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written python code which involves the use of dictionaries. I now wish
Scenario: I have an application (C#) that expects a SQL database and login, which
I wish to use the method with the following signature: exec(String command, String[] envp,
I wish to use a jQuery .load(oracle apex url) query. I have a main
I have two stored procedures I wish to use in my stored procedure, but
I have a .gif file which i wish to use as the background image
We use LINQ to Entities to write entries into an Audit database (SQL Server
I currently have two joined tables in a SQL Server database, one with news
We have a .NET 2.0 winforms app that connects to a SQL Server 2005
I wish to make fields in a remote public Sybase database outlined at http://www.informatics.jax.org/software.shtml#sql

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.