DB2 Insert Record 使用方法
default.aspx |
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using IBM.Data.DB2; private void DB2InsertConnection() { String ConnectionString = "Server=<Host Name>;Database=<Database Name>;UID=<Account ID>;PWD=<Account Password>"; DB2Connection conn = new DB2Connection(ConnectionString); conn.Open(); String SQLStatement = "INSERT INTO Test (ID, Name) VALUES (4,'Row 4')"; DB2Command cmd = new DB2Command(SQLStatement, conn); cmd.ExecuteNonQuery(); conn.Dispose(); cmd.Dispose(); conn.Close(); } |