DEV Community

Cong Li
Cong Li

Posted on

Connecting to GBase 8s Database via ADO.NET with C# on Windows (1)

GBase 8s, a database system developed by GBASE, is widely used in industries such as finance and telecommunications. For developers, mastering how to connect to GBase 8s using C# and ADO.NET in a Windows environment is crucial for improving development efficiency and data processing capabilities. This series of articles will be divided into two parts, guiding you step-by-step through the configuration process, from environment setup to code implementation.

Overview

This article demonstrates how to use ADO.NET to operate the GBase 8s database in a Windows 10 environment with C#. The example is only guaranteed to work under the same conditions and may vary in other environments.

The database version used in this example is GBase8sV8.8_TL_3.5.1_x86_64, and the CSDK version is clientsdk_3.5.1_1_4afd74_WIN2003_x86_64 (Windows).

Note: Always use the corresponding driver version for new database versions!

Database Server Information Used in This Example

No. Parameter Name Example Value Description
1 Host Name 192.168.137.66 Database server host name or IP address
2 Port Number 6666 Port number used by the database server
3 Database Service Name yangzai Database service name (DBSERVERNAME)
4 Database Name testdb1 Database name (DBNAME)
5 Database Charset zh_CN.utf8 Database character set (DB_LOCALE)
6 Client Charset zh_CN.utf8 Client character set (CLIENT_LOCALE)
7 GLU Support 1 GLU support (GL_USEGLU)

Database and CSDK Download Link

Download GBase 8s and CSDK

Installing and Configuring CSDK on Windows

1. Installing CSDK

You need administrator privileges to install CSDK. Extract the CSDK installation package and run installclientsdk.exe as an administrator to start the installation.

Image description

Image description

1) License Agreement: You need to scroll to the bottom of the agreement page to select the checkbox to accept the agreement.

Image description

2) Set Installation Path: In this example, we use the path C:\Program Files\GBase Client-SDK.

Image description

3) Feature Selection: By default, CSDK installs the following components: OLEDB runtime, C++ interface, ESQL\C, .NET driver, client program LIBDMI, ODBC driver, general database tools, and GLS.

Image description

4) Installation Preview: Review the installation components and proceed with the installation.

Image description

After the installation is complete, CSDK for Windows is successfully installed!

2. Configuring CSDK

After installation, you need to configure the client connection settings. Find the GBase Client-SDK 4.10 (64-bit) directory in the Start Menu and run the Setnet32 program as an administrator.

1) Configuring the Server Information Tab

Image description

Fill in the database server information in the Server Information tab as shown below:

Setting Description
GBase 8s Server Name of the database instance to connect to
HostName Database server IP address
Protocolname Connection method
Service Name Port number

2) Configuring the Host Information Tab

Image description

Fill in the host information in the Host Information tab as shown below:

Setting Description
Current Host Select the previously configured HostName
User Name Username
Password Option Password option
Password Password

In this article, we introduced how to install and configure the CSDK on Windows. In the next article, we will continue to discuss how to perform database operations using C#. Thank you for reading!

Top comments (0)