After you install the driver, you can run the following sample code to test the connection to OceanBase Database.
using Oceanbase;
var connectionString = "Server=host;Port=port;Database=schema_name;User Id=username@tenant_name#cluster_name;Password=password;";
using var conn = new OracleConnection(connectionString);
conn.Open();
using var cmd = conn.CreateCommand();
cmd.CommandText = "SELECT 1 FROM DUAL";
var result = cmd.ExecuteScalar();
Console.WriteLine($"Query result: {result}");
conn.Close();
Note
For more information about the connection string format and parameters, see Connection strings. In Oracle mode, you must specify the Database (schema) parameter. In MySQL mode, you can use the same connection method as that of MySQL Connector.