| |||||||||||||||||||
<connectionStrings> add ElementASP.NET Syntax ASP.NET Configuration Sections .NET Framework version 2.0 Adds a connection string as a name/value pair to the collection of connection strings. This element is new in the .NET Framework version 2.0. <add name = "connection string name" connectionString = "connection string" providerName = "ADO.NET data provider" /> Attributes and ElementsThe following sections describe attributes, child elements, and parent elements. Attributes
Child ElementsNone. Parent Elements
RemarksThe add element adds a connection string as a name/value pair to the collection of connection strings in the connectionStrings element. The connectionStrings element specifies a collection of database connection strings ( as name/value pairs ) for ASP.NET applications and ASP.NET features. Default ConfigurationConnection strings that are contained in a parent configuration file are inherited unless the clear element is used in the child configuration file. The following default element element is configured in the Machine.config file. <connectionStrings>
<add name = "LocalSqlServer"
connectionString = "data source=.\SQLEXPRESS;Integrated Security=SSPI;
AttachDBFilename= | DataDirectory | aspnetdb.mdf;User Instance=true"
providerName = "System.Data.SqlClient" />
</connectionStrings>
ExampleThe following code example demonstrates how to configure a connection string for an application that uses the Northwind database. <configuration>
<connectionStrings>
<add name = "Northwind" connectionString =
"Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Northwind;"
providerName = "System.Data.SqlClient" />
</connectionStrings>
</configuration>
See Also<connectionStrings> Section <connectionStrings> clear Element <connectionStrings> remove Element |
| ||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme