September 2003
Intermediate to advanced
624 pages
14h 27m
English
Configuration files are XML-based files that can be used to store application settings so that they can be changed as needed without recompiling the application. The Windows Forms and Web Forms solutions each use a configuration file to store all configuration settings.
The configuration file for all Web Forms solutions contains the following elements.
<appSettings>
<add key="DataConnectString"
value="Data Source=(local);user id=sa;password=;Initial Catalog=Northwind;" />
</appSettings>The configuration file for all Windows Forms solutions follows.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="Project_Directory" value="c:\\AdoDotNetCookbook\\CS\\" /> <add key="Temp_Directory" value="c:\\temp\\" /> <add key="Sql_ConnectString" value= "Data Source=(local);user id=sa;password=;Initial Catalog=Northwind;" /> <add key="Sql_SqlAuth_ConnectString" value= "Data Source=(local);Initial Catalog=Northwind;User ID=sa;password=;" /> <add key="Sql_Master_ConnectString" value= "Data Source=(local);Integrated security=SSPI;Initial Catalog=master;" /> <add key="Sql_Msde_ConnectString" value="Data Source=(local)\vsdotnet; Integrated security=SSPI;Initial Catalog=Northwind;" /> <add key="OleDb_ConnectString" value="Provider=SQLOLEDB; Data Source=(local);Integrated Security=SSPI;Initial Catalog=Northwind;" /> <add key="OleDb_SqlAuth_ConnectString" value="Provider=SQLOLEDB; Data Source=(local);Initial Catalog=Northwind;User ID=sa;password=;" ...
Read now
Unlock full access