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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:27:11+00:00 2026-06-07T22:27:11+00:00

I am trying to make some simple libraries that require database access. What I

  • 0

I am trying to make some simple libraries that require database access. What I don’t get is how to pass the connection string to the library… Right now I have a db.config in my dll, but I’m not sure how to reference it from within the dll etc…

This is how I have setup the libraries

[Solution File]

  • Library1
    • db.config
  • Library2
    • linked db.config

<configuration>
        <!-- Connection string -->
    </configuration>
  1. How do I reference the db.config from within dll?
  2. How do I reference the db.config from a web applications web.config?
  • 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-07T22:27:13+00:00Added an answer on June 7, 2026 at 10:27 pm

    Real simple:

    1) If this happens to be a .Net .dll, you can store it in “app.config” or “web.config”:

    Example:

    <?xml version="1.0" encoding="utf-8" ?>
      <configuration>
        <connectionStrings>
          <add name="DigiBrd"
               connectionString="server=localhost;user id=****;Password=****;database=DigiBrd"
               providerName="MySql.Data.MySqlClient" />
      </connectionStrings>
    </configuration>
    
    String cnString =
      ConfigurationManager.ConnectionStrings["DigiBrd"].ConnectionString;
    

    2) You can also store the connection string anywhere that the .dll can read it. For example, you can use an .ini file or the registry.

    3) You can implement a getConnectionString() method in your .dll.

    4) Etc. etc. etc.

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

Sidebar

Related Questions

I'm trying to make a simple generator that takes some syllables from a user
I'm trying to make a simple application that loads and runs some classes during
I'm trying to programmatically load some clojure libraries to make a simple auto-test program.
I'm trying to make some input fields that I would like to work like
I'm trying to make some text bold using HTML, but I'm struggling to get
I'm trying to make some utils for using with sqlite databases. For that I
I'm trying make a simple control, with a some path in it. And binding
I am trying to understand a simple command-line string that executes Javac and passes
We're trying to get some usage metrics on a VB6 application that we are
I'm trying to make a simple application in C# that allows me to kill

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.