Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Membership Role Provider for Multiple databases

Membership Role Provider for Multiple databases

Scheduled Pinned Locked Moved ASP.NET
databasecsharpasp-netsql-serversysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fahad Azeem
    wrote on last edited by
    #1

    I am developing an application for which I have to provide a hosted version for the client.Well the problem that is bugging me is as follows: Different users from different companies will be connecting to the ASP.net application. I want to keep each company's data and login information in a separate database and one ASP.net application in the front. Now the problem is how to make this possible? In SQL Server Role and Membership provider, database connection string is in web.config. If I have to write a custome provider, then what should be the approch by keeping one ASP.net application in the front for multiple databases. I would appreciate ideas and comments on the problem Thanks, Fahad

    E 1 Reply Last reply
    0
    • F Fahad Azeem

      I am developing an application for which I have to provide a hosted version for the client.Well the problem that is bugging me is as follows: Different users from different companies will be connecting to the ASP.net application. I want to keep each company's data and login information in a separate database and one ASP.net application in the front. Now the problem is how to make this possible? In SQL Server Role and Membership provider, database connection string is in web.config. If I have to write a custome provider, then what should be the approch by keeping one ASP.net application in the front for multiple databases. I would appreciate ideas and comments on the problem Thanks, Fahad

      E Offline
      E Offline
      eggsovereasy
      wrote on last edited by
      #2

      When a user logs in you could produce the connection string "" + companyName + "" and store it in a Session variable, then everytime you use the connection string you do Session["ConnectionString"] rather than ConfigurationSettings.AppSettings["ConnectionString"]. If each company has their own login frontend then this should be easy.

      F 1 Reply Last reply
      0
      • E eggsovereasy

        When a user logs in you could produce the connection string "" + companyName + "" and store it in a Session variable, then everytime you use the connection string you do Session["ConnectionString"] rather than ConfigurationSettings.AppSettings["ConnectionString"]. If each company has their own login frontend then this should be easy.

        F Offline
        F Offline
        Fahad Azeem
        wrote on last edited by
        #3

        The problem is the Membership provider has no interface to change the underlying connection string, it is in the web.config file. Should i try to add connection string property to the SQLMembership provider and try to use that. How that sounds?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups