Connecting to a Data Source
- Last Updated: May 12, 2026
- 2 minute read
- OpenAccess SDK
- Version 8.1
- Documentation
Once the ADO.NET Client is installed, you can connect from your application to your data source with a connection string.
The following example illustrates connecting to the underlying database using the ADO.NET Client from an application developed in Visual Studio.
If you are using Visual Studio:
-
In the Solution Explorer, right-click References; then, click Add Reference.

-
Select DataDirect OpenAccess SDK Client for .NET in the component list.

-
Click OK. The application references now include DDTek.OpenAccess, the assembly name for the ADO.NET Client.

-
Check the beginning of your application. If the ADO.NET Client namespace is not present, add it, as shown in the following C# code fragment:
// Access OpenAccess Server using System.Data; using DDTek.OpenAccess; ``` -
Add the connection information for your server and exception handling code, as shown in the following C# code fragments. (See Specifying Connection Options for the connection string options.)
DBConn = new OpenAccessConnection("Host=myhost Port=myport; User ID=myUID;Password=myPWD;ServerDataSource=mySDSN"); try { DBConn.Open(); Console.WriteLine ("Connection successful!"); } // Display any exceptions catch (OpenAccessException ex) { // Connection failed Console.WriteLine (ex.Message); return; } -
Close the connection.
// Close the connection DBConn.Close();