connectionStrings Element

The <connectionStrings> element holds a variety of key-value pairs for various settings, including the database connection strings.

Key

Description

Database<DatabaseName>

Database connection strings hold the information related to the databases connected to the application.

Parameter

Description

Provider

Set to Microsoft.Jet.OLEDB.4.0 for Microsoft Access.

Unspecified (and not used) for other databases.

Data Source

Microsoft Access

The path to the database file (.MDB).

Microsoft SQL Server

The name or network address of the instance of Microsoft SQL Server to which to connect.

MySQL

The server/host where MySQL is running.

Oracle

The Oracle instance name.

Database

Microsoft Access

The name of the database.

Microsoft SQL Server

The name of the database.

MySQL

The name of the database.

Oracle

The Oracle schema name.

Note: the Database element in an Oracle connection string is used by Iron Speed Designer at design-time.  At run-time, the Database element is not used by applications.

Trusted_Connection

true
yes

The current Windows account credentials are used for authentication.

false
no

User ID and Password are specified in the connection.

Password

Microsoft Access

The password setup in the database or "" for no password.

Microsoft SQL Server

The password for the Microsoft SQL Server account logging on.  (Not recommended.  To maintain a high level of security, it is strongly recommended that you use the Trusted_Connection keyword instead.)

MySQL

The MySQL password.

Oracle

The Oracle password.

Port

For MySQL, the TCP port number where MySQL listens on the server.

User ID

Microsoft Access

The user ID identified in the database, or the default 'Admin' username.

Microsoft SQL Server

The Microsoft SQL Server login account.  (Not recommended.  To maintain a high level of security, it is strongly recommended that you use the Trusted_Connection keyword instead.)

MySQL

The MySQL user ID.

Oracle

The Oracle user ID.

Jet OLEDB:System Database

Microsoft Access only.  Used for opening a system database that uses Access Workgroup Information security specified in an .MDW file.

Jet OLEDB:Database Password

Microsoft Access only.  Used for opening a password-protected database.

Jet OLEDB:Database Locking Mode

Microsoft Access only.  Specifies the mode used when locking the database to read or modify records.

0

Page-level locking

1

Row-level locking

Note   A database can only be open in one mode at a time. The first user to open the database determines the locking mode to be used while the database is open.

Mode

Microsoft Access only.  Specifies database access permissions.

Read (1)
Write (2)
Share Deny Read  (4)
Share Deny Write  (8)
Share Exclusive  (12)
Share Deny None  (16)

For details, see:

http://technet.microsoft.com/en-us/library/ee252601(BTS.10).aspx

Example: Microsoft SQL Server database connection

<configuration>

     <connectionStrings>

          <add key=”DatabaseNorthwind1” value=”

              Data Source=(local);

              Database=Northwind;

              Trusted_Connection=yes;

              User ID=;

              password= ” />

     </connectionStrings>

</configuration>

Example: Microsoft Access database connection

     <connectionStrings>

          <add key=”DatabaseNorthwind1” value=”

              "Provider=Microsoft.Jet.OLEDB.4.0;
              Data Source=C:\IronSpeed\TestAccessDB\TestTypes.mdb;
              Jet OLEDB:Database Locking Mode=1;
              Mode=Share Deny None" />

     </connectionStrings>

 

See Also

Web.config Configuration File