Get Dynamically connection string in app.config file c#

Get Dynamically connection string in app.config file c#

Today, We want to share with you Get Dynamically connection string in app.config file c#.In this post we will show you dynamic connection string in c# windows application, hear for how to get connectionstring from app config in c# class library we will give you demo and example for implement.In this post, we will learn about how to get connection string from app.config in windows application with an example.

Now in this post, I will explain Read connectionstring from app.config c# with appropriate example.

c# – Get connection string from App.config

Write below lines of ASP.NET MVC Web Configuration code to read connection string from app.configue

string _ConnectionString = System.Configuration.ConfigurationManager.AppSettings[key];

Dynamic connection string in c# windows application

First of all just Add a reference simple of System.Configuration to your main page.

using System.Configuration;

app.config fetch the data connection string as follow.

string conStr = ConfigurationManager.ConnectionStrings["pakainfo"].ToString();

How to get Connection String from App.Config in C#

Using the Code

var connectionString=ConfigurationManager.ConnectionStrings["pakainfoManagements"].ConnectionString;

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Read (Get) Connection String from App.Config file using C# and VB.Net.I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related FAQ

Here are some more FAQ related to this Article:

  1.   Login Multiple Skype Accounts on Windows, Mac, Linux
  2.   PHP Compare Two Arrays Values
  3.   MongoDB CRUD Tutorial With Example From Scratch
  4.   Angular 9/8 Material Input Box Examples
  5.   WooCommerce Get Product Tax, Shipping & Stock
  6.   Base64 Encode Decode string using Javascript
  7.   Create A Setup File In Visual Studio 2015
  8.   Simple Laravel Pagination Example Tutorial
  9.   Laravel Pagination Example Tutorial
  10.   Laravel 6 return view jQuery ajax request example

Leave a Reply

Your email address will not be published. Required fields are marked *