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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:38:15+00:00 2026-05-25T00:38:15+00:00

Whenever I add dataset in my class library project using the wizard it gives

  • 0

Whenever I add dataset in my class library project using the wizard it gives me an option to save the connection string in app.config file and after selecting the option it do save the string in file but when I check the dataset designer it always saves it in project property object:

private void InitConnection() {
            this._connection = new global::System.Data.SqlClient.SqlConnection();
            this._connection.ConnectionString = global::BaseClassLibrary.Properties.Settings.Default.DBConnectionString;
        }

and this is not so useful because when I try to use this project dll and override the connection string by writing it in web.config or app.config … it doesn’t refer to it …

and one interesting fact that if you follow the same process of adding dataset using wizard in web project then it actually refer web.config for connection string … which is a bit strange … and in web project dataset don’t generate designer classes …

Is there anyway I can do the desire action?

  • 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-05-25T00:38:17+00:00Added an answer on May 25, 2026 at 12:38 am

    The Properties type is a wrapper around application and user-specific settings as described here.

    It appears that you are attempting to get the configuration settings from your library assembly (.dll) rather than the configuration settings from the application/site that is referencing your library. I am guessing this based on the fact that you are using this property:

    global::BaseClassLibrary.Properties.Settings.Default.DBConnectionString;
    

    In situations where a referenced assembly needs a configuration setting from the running application/site I usually:

    1. Create an AppNameApplication static type in a core library (that is, an assembly with few or no other custom dependencies)
    2. Create properties for either the configuration as a whole (if using a custom ConfigurationSection) or for each setting needed.
    3. Initialize this static class at the start of the application (main or Global.Applicaton_Start)
    4. Reference AppNameApplication from the library assembly types to get access to these configuration settings.

    Note that this static type needs to be defined in one of your core libraries because you cannot have a circular reference: App – Library – App.

    Hope this helps.

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

Sidebar

Related Questions

I have a PHP application using an Oracle XE database. Whenever I add a
Whenever I try to add a new project to my SourceSafe repository it creates
Whenever I write a new class and add some internal fields, I use an
I use updatepanel and updateprogress in my project. Whenever I add updatepanel to a
This is strange, whenever I add using namespace ... to a header file it
I'm using Visual Studio 2003. In debug mode, whenever I add a break point
I have an app using Devexpress controls, xtragrids and chkboxlists I have a dataset
I'm using Crystal 9, and whenever I add a new section to a report,
I'm using the acts_as_list plugin with rails 3.1 and whenever I add or remove
Whenever I add a new html file (or other text file) to the project

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.