您的位置:首页 > 其它

Array Binding

2004-11-16 09:23 302 查看
...
// Create an array of values that need to be inserted
int[] myArrayDeptNo = new int[3]{10, 20, 30};

// Set the command text on an OracleCommand object
cmd.CommandText = "insert into dept(deptno) values (:deptno)";

// Set the ArrayBindCount to indicate the number of values
cmd.ArrayBindCount = 3;

// Create a parameter for the array operations
OracleParameter prm = new OracleParameter("deptno", OracleDbType.Int32);
prm.Direction = ParameterDirection.Input;
prm.Value = myArrayDeptNo;

// Add the parameter to the parameter collection
cmd.Parameters.Add(prm);

// Execute the command
cmd.ExecuteNonQuery();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: