Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<small></small>
I have following code in my app.config

dataconfiguration defaultdatabase="ForeTVSQL"

/dataconfiguration

HTML
connectionstrings
add name="ForeTVSQL" connectionstring="Password=msafocus;Persist Security Info=False;User ID=sa;Initial Catalog=MainSource_Version;Data Source=130.11.55.16\sql2012;Connect Timeout=180;"
		  providerName="System.Data.SqlClient" />

/add
/connectionstrings


I want to get defaultDatabase at runtime. How can I get it?
Please help!!

Thanks in advance!
Radhika
Posted
Updated 9-Apr-15 17:53pm
v3

If I understood the question correctly, you can use AppSettings[^] to read the configuration.
 
Share this answer
 
In connection strings
XML
<dataConfiguration defaultDatabase="YourDatabase" />
 
Share this answer
 

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