Application Configuration File.
Open the file and it will be like this (without the key setting, that is my default setting I added to the file) :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings >
<add name ="DbConnection" connectionString ="Data Source=USER-PC;Initial Catalog=CategoricalClustering;User Id=sa;Password=home;" providerName ="System.Data.SqlClient"/>
</connectionStrings>
</configuration>
Then in code, we need the assembly we need to manage the configuration file:
1 | using System.Configuration; |
Actually is very easy, to read a configuration just do this:
Nice. Very easy to understand
ReplyDeleteNice.It's very shortest way to connection string app.config in c#.
ReplyDeleteya it works.But i need more details abt deploying the codes
ReplyDelete