惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - Franky
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
有赞技术团队
有赞技术团队
美团技术团队
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
T
Tailwind CSS Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
I
InfoQ
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog

博客园 - Vincent

reCaptcha 在UpdatePanel 和 ModalPopup中的使用 - Vincent Invalid character in a Base-64 string System.ArgumentOutOfRangeException at System.Web.HttpCachePolicy.UtcSetLastModified (DateTime utcDate) Fabulous Adventures In Coding Microsoft will end OEM and shrink-wrapped sales of Windows XP on June 30, 2008 - Vincent My AutoCompleteExtender Windows Live Writer GRI-MindHarbor软件公司 单表继承 (Single Table Inheritance) 很久没有写blog了. Base64 MD5加密 信用卡是超前消费的一种手段 vs.net2003无法打开*.xsd文件的解决方法 针对MS Project 2003 的开发 Test Your Knowledge of Microsoft Visual Studio .NET page event Microsoft Office InfoPath 2003 Toolkit for Visual Studio .NET 在Code-Behind中操作WebUserControl
写给yzx110的一个实例,仅作参考!
Vincent · 2005-11-29 · via 博客园 - Vincent

 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 中国大陆许可协议进行许可。必须保留本文的署名以及原文链接.

posted @ 2005-11-29 00:47  Vincent  阅读(687)  评论(0)    收藏  举报

刷新页面返回顶部