skip to Main Content

I have a specific requirement for developing an application in ASP.NET MVC. The application will serve as a DETAILS SECTION ONLY web app, where data from six databases needs to be seamlessly integrated and displayed.

Currently, I’m in the research phase and exploring the best approach to achieve this. I understand the complexity involved in establishing connections to multiple databases and creating APIs to retrieve the necessary data.

I would greatly appreciate any insights, suggestions, or best practices from the community to guide me in the right direction.

2

Answers


  1. The default configuration system in .NET enables you to define more than one connection string. If you need to connect to six databases, then define six connection strings:

    <connectionStrings>  
      <add name="no1" connectionString="connstr1;" />
      <add name="no2" connectionString="connstr2;" />
      <add name="no3" connectionString="connstr3;" />
      <add name="no4" connectionString="connstr4;" />
      <add name="no5" connectionString="connstr5;" />
      <add name="no6" connectionString="connstr6;" />
    </connectionStrings>
    

    Then write code to manage and use the correct connection string for the various databases.

    Login or Signup to reply.
  2. Please follow these steps :

    Solution will be simple as below

    1. Add connection string for centralized db in web.config. & use it while login user in.

    2. Store user specific connection string in user login details table in another column or in another table.

    3. During user log in get user data with specific connection string & store it in session.

    4. Further use the connection string from session & do your actions.

    Thanks

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search