Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

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:

  1. In the Solution Explorer, right-click References; then, click Add Reference.

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

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

  4. 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;
     ```
    
  5. 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;
    }
    
  6. Close the connection.

    // Close the connection
    DBConn.Close();
    
TitleResults for “How to create a CRG?”Also Available inAlert