Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
2.71/5 (3 votes)
See more:
hiiii

how do i get connection string in .net framework 4.0 using in c#??
Posted
Comments
Ramug10 5-Mar-14 1:06am    
Have you tried it? Please try this yourself and ask question if you face any problem in your code. Thanks!
Vedat Ozan Oner 5-Mar-14 1:43am    
google answers this question in 0.34 seconds: https://www.google.com.tr/search?q=how+do+i+get+connection+string+in+.net+framework+4.0+using+in+c%23

1 solution

Please try is as below.

C#
using System.Configuration;

string connectionString = ConfigurationManager.ConnectionStrings["StringName"].ConnectionString;


ConfigurationManager Class
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900