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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:27:49+00:00 2026-06-14T14:27:49+00:00

I have the following in my App.config, how do I make the code below

  • 0

I have the following in my App.config, how do I make the code below it work????

configuration>
    <configSections>
    </configSections>
    <connectionStrings>
        <add name="WpfDatabind3.Properties.Settings.cbfSQL1ConnectionString"
            connectionString="Data Source=STEPHANS-PC\SQLEXPRESS;Initial Catalog=cbfSQL1;Integrated Security=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>

I can’t figure out how to access the connection string in the App.config.

DataSet myDataSet;

private void OnInit(object sender, EventArgs e)
{
  string mdbFile = Path.Combine(AppDataPath, "BookData.mdb");
  string connString = string.Format(
      "Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}", mdbFile);
  OleDbConnection conn = new OleDbConnection(connString);
  OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM BookTable;", conn);

  myDataSet = new DataSet();
  adapter.Fill(myDataSet, "BookTable");

  // myListBox is a ListBox control. 
  // Set the DataContext of the ListBox to myDataSet
  myListBox.DataContext = myDataSet;
}
  • 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-14T14:27:50+00:00Added an answer on June 14, 2026 at 2:27 pm

    Add reference to System.Configuration.dll to your project. Then use ConfigurationManager class. It allows to get connection string settings by name:

    string connString = ConfigurationManager
       .ConnectionStrings["WpfDatabind3.Properties.Settings.cbfSQL1ConnectionString"]
       .ConnectionString;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to get debugging working without an app.config. I have the following code:
I have the following tag in my ASP.NET Web.config application: <add name=monitorEntities connectionString=metadata=res://*/Models.MonitorDB.csdl|res://*/Models.MonitorDB.ssdl|res://*/Models.MonitorDB.msl;provider=System.Data.SQLite;provider connection
I have a WCF server which has the following app.config file: <?xml version=1.0?> <configuration>
I have a the following server side app.config for a WCF service: <system.serviceModel> <bindings>
I have defined a config section in my app.config in the following way: <?xml
I have the following directory structure: project/ .git/ ... app/ ... config/ initializers/ braintree.rb
In my Zend Framework app, I have following code: index.php $app_started_time = time(); layout.phtml
If I have the following setting in my app.config file. It is a setting
For example suppose I have the following app.get('/', function(req, res) { var ip; if(req.headers['x-forwarded-for']){
I have following flow of app : First screen is Login screen and if

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.