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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - 阿春

培养领袖气质 带游标的存储过程 SQL语句集锦 (转) 正则表达式基础知识(转) http://www.cnblogs.com/pwqzc/archive/2006/06/12/423651.html(转,好东东) 脏字典 转 测试网站各项性能的31 个免费在线工具 最佳的75个网络安全工具 (转载) 截断表内容 和 删除表 利用.NET2.0自带的数据库访问工厂写的数据库访问基类 sql 语句 :取总数 下载指定URL的HTML代码 执行查询语句 给一个文本 和 编码类型 转换成 规定类型的 URL 编码 C#采集器 ss 触发器 防止注入的sql调用 程序调用sql
工厂模式的数据库连接
阿春 · 2008-03-18 · via 博客园 - 阿春

 /// 数据连接字符串
        /// </summary>
        private static string connectionString;
        /// <summary>
        /// 数据库 驱动 提供者
        /// </summary>
        private static string providerName;
        /// <summary>
        /// 数据库 驱动 提供者 工厂
        /// </summary>
        private static DbProviderFactory factory;

        static Database()
        {
            ConnectionStringSettings settings = ConfigurationManager.ConnectionStrings["default"];
            connectionString = settings.ConnectionString;
            providerName = settings.ProviderName;
            factory = DbProviderFactories.GetFactory(providerName);
        }