Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How we can make connection string in application configration file?????
Posted

your name reminds me of harold and kumar :P

You just add it, like any other string, and read it just like any other string. Any sample you find online for using the config file, will work for your connnection string.
 
Share this answer
 
I suggest that you should do googling :)
 
Share this answer
 
XML
Define your connection string in web.config file as:
<connectionStrings>
    <add name="connString" connectionString="...." />
</connectionStrings></pre>

And use it as follows:
<pre lang="C#">ConfigurationManager.ConnectionStrings["connString"].ToString();
 
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