Results 1 to 6 of 6

Thread: Login Control in ASP.Net

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Login Control in ASP.Net

    I want to use Login Control in ASP.Net. I click on ASP.Net configuration. Change Authentication type, Create User named Sonia... & do all the steps. & successfully able to logged in & logged out of the application.


    I have Created one user Named Sonia thru ASP.Net Web Configuration Tool.

    Now in my project I have Separate User Creation form, Through which user create his own username & that username & password is saved in my SQL database.

    Suppose User That is saved in database is
    UserName - ABC
    Password - 123

    Now i want that users who exist in my db, can login in my app. thru Login Control..Is that possble?

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Login Control in ASP.Net

    Yes, of course it is.
    What is the exact problem that you are having?
    Also see here for explanation:
    http://msdn.microsoft.com/en-us/libr...vs.100%29.aspx
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Login Control in ASP.Net

    Hello,

    Out of the box, the ASP.Net Membership Provider is going to create a SQL Database for you. It already has tables for the username, password, etc.

    Are you saying that you already have a SQL Database, populated with information that you want to use with the Login controls? If this is the case then you are going to have to create a custom Membership Provider, and extract the information from your database, and then provide it to the user controls. This is quite a bit of work, and if you haven't already got a populated database, then I would suggest that you use the one that the Membership Provider creates for you.

    Gary

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2008
    Posts
    474

    Re: Login Control in ASP.Net

    I have successfully installed the ASP.Net membership tables in SQL database.
    Now I add the connecting string in the Web.Config
    Code:
    <appSettings/>
      <connectionStrings>
        <add name="Connection" connectionString="Data Source=SONIA-PC\\SQLEXPRESS;Integrated Security=true;Initial Catalog=ASPNETServices" providerName="System.Data.SqlClient"/>
    
      </connectionStrings>
    BUt when i check for the provider , by clicking on ASP.Net Configuration --> Provider -->Click on Test ( SEE FIGURE ATTACHED) --> I am getting the error
    Code:
    Could not establish a connection to the database. 
    If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
    Attached Images Attached Images  

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: Login Control in ASP.Net

    I think you need one "\" "SONIA-PC\SQLEXPRESS;"
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Login Control in ASP.Net

    Yip, I think sapator is correct.

    You can use this site:

    http://connectionstrings.com/

    To confirm the correct connection string to use.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width