using System;
using Hitachi.HiRDB;
namespace test_C
{
class Sample
{
[STAThread]
static void Main(string[] args)
{
try
{
// Create a Connection object
HiRDBConnection cn = new HiRDBConnection("dsn=pc;"); ...1
// Connect to the database
cn.Open();
// Create a Command object
HiRDBCommand cm = new HiRDBCommand();
// Create a table
cm.Connection = cn;
cm.CommandText = "create table ex (a int)";
cm.ExecuteNonQuery(); ..................................1
// Disconnect from the database
cn.Close();
}
catch (HiRDBException ex)
{
Console.WriteLine(ex);
}
catch (System.Exception ex)
{
Console.WriteLine(ex);
}
}
}
} |