Scalable Database Server, HiRDB Version 8 UAP Development Guide
This example inserts 123, 200, and null in the ex table:
// Create objects such as a connection object HiRDBConnection pConn = new HiRDBConnection("connection-character-string"); HiRDBCommand pCom = pConn.CreateCommand(); // Connect to the database pConn.Open(); // Create a parameter object HiRDBParameter pPar = pCom.CreateParameter(); // Set parameters pPar.Direction = ParameterDirection.Input; pPar.HiRDBType = HiRDBType.Integer; object [] aValue = new object[3]; aValue[0] = 123; aValue[1] = 200; aValue[2] = null; pPar.Value = aValue; pCom.Parameters.Add(pPar); .........................................1 // Use parameters to execute SQL statement pCom.CommandText = "insert into ex values(?)"; pCom.ExecuteNonQuery(aValue.Length); ...............................2 // Disconnect from the database pConn.Close(); |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.