Specifying Connection Strings for Different Types of Data
Accessing SQL Server using Windows Authentication
If accessing SQL Server data using Windows Authentication, your connection string might look like this:
<add key="Northwind\Connection" value="Data Source=(local);Initial Catalog=Northwind;Integrated Security=True" />
Accessing SQL Server using SQL Server Authentication
If accessing SQL Server data using SQL Server authentication, your connection string might look like this:
<add key="maindata\Connection" value="server=(local);uid=;pwd=;database=NorthWind;" />
Attach a Database File or Connect to a Local SQL Server Express Instance
When accessing SQL Server data using SQL Server Express, your connection string might look like this:
<add key="maindata\Connection" value="Server=.\SQLExpress;AttachDbFilename=c:\MyDBFile.mdf;Database=DBName;Trusted_Connection=Yes;" />
Note, the Server name syntax is SERVERNAME\SQLEXPRESS where SERVERNAME is the of the computer. A period (.) indicates the local machine.
Accessing Oracle using the Oracle .NET Data Provider
If accessing Oracle data with the Oracle .NET Data Provider (ODP.NET), your connection string and data access class setting might look like this:
<databases> <add key="SCOTTORACLE\Connection" value="User Id=SCOTT;Password=tiger;Data Source=Northwind"/> <add key="SCOTTORACLE\DataAccessClass" value="DataAccessOracle"/> </databases>
Accessing Visual FoxPro Data
If accessing Visual FoxPro data with the OLE DB .NET Data Provider from Microsoft, your connection string and data access class setting might look like this:
<add key="maindata\Connection" value="Provider=vfpoledb.1;Data Source=MainData.dbc" /> <add key="maindata\DataAccessClass" value="DataAccessVFP" />
See also:
If You are Having Problems Connecting...
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/19/18
Comment or report problem with topic
