






















1
public bool DBCommandWrapper(string commandText, OracleParameterCollection Parameters) {
2
try {
3
this.dbCommand = new OracleCommand(commandText, (OracleConnection) this.dbConnection);
4
5
this.dbConnection.Open();
6
7
8
9
10
foreach (OracleParameter op in Parameters) {
11
if (op.OracleType ==OracleType.Char ) {
12
this.dbCommand.Parameters.Add(op.ParameterName, OracleType.Char).Value = Convert.ToByte(op.Value);
13
}
14
else {
15
if (op.OracleType == OracleType.VarChar) {
16
op.Value = op.Value==null ? OracleString.Null : op.Value;
17
this.dbCommand.Parameters.Add(op.ParameterName, op.DbType).Value = op.Value;
18
}
19
else {
20
this.dbCommand.Parameters.Add(op.ParameterName, op.OracleType).Value = op.Value;
21
}
22
}
23
}
24
25
this.dbCommand.ExecuteNonQuery();
26
27
28
29
return true;
30
}
31
catch (Exception ex) {
32
33
sb.Append("Error Message: ");
38
sb.Append(ex.Message);
39
sb.Append("\r\n");
40
return false;
41
}
42
finally {
43
this.dbCommand.Parameters.Clear();
44
this.dbConnection.Close();
45
}
46
47
}

本作品采用知识共享署名 2.5 中国大陆许可协议进行许可。必须保留本文的署名以及原文链接.
博客园
© 2004-2026
浙公网安备 33010602011771号
浙ICP备2021040463号-3
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。