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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:30:26+00:00 2026-05-18T08:30:26+00:00

I am new to desktop application development and currently building a desktop application using

  • 0

I am new to desktop application development and currently building a desktop application using layered architecture (user interface, DAL, BLL).

In web development I used to store the connection string in web.config and my class library was accessing it from there. Please guide me how & where connection string should be stored for DAL in desktop application. I tried to add an app.config file in my class library and access the connection string like this:

ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString)

But it throuws an error: “Object reference not set to an instance of an object.”

Kindly guide me on this. Thanks for your support and sharing.

  • 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-18T08:30:27+00:00Added an answer on May 18, 2026 at 8:30 am

    Yes, in a desktop application, all configuration should be in the app.config for that application. The class libraries used by this desktop application will get their config from that app.config by default.

    If this line throws an exception:

    ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString
    

    then it’s most likely because no <connectionStrings> entry of name “connectionstring” exists. Check for NULL:

    if(ConfigurationManager.ConnectionStrings["connectionstring"] != null)
    {
        string connStr = ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a new desktop application that will have several views such as a
I work on a desktop application and I send frequent betas to testers using
I have revoked my active development certificate ,and unable to create a new one,
Compact Framework .net C# Desktop Application for Windows Mobile I got 2 buttons that
I am working on a desktop application for which I need to load the
I just downloaded the latest version of Netbeans - 6.9.1. I've been using 6.8
I am starting out on a new project and have fallen in love with
Hi I would like to learn and develop applications for iPhone. Can some one
Ok, I'm in a world of pain at the moment. We'd been developing with

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.