SQL 数据库操作类


                                                          SQL数据库操作类

我把数据库操作类整理了一下,它包含了常用的数据库操作,由三种方式:简单的SQL拼接字符串的形式,SQL语句使用参数的形式和存储过程的形式,每种形式均有五个方法,并且都有事务.,可以直接调用.代码如下:

  1//======================================================================
  2//
  3//        Copyright (C) 2007-2008 三月软件工作室    
  4//        All rights reserved
  5//
  6//        filename :SQLDataBase
  7//        description :
  8//
  9//        created by 侯垒 at  04/14/2008 18:33:32
 10//        http://houleixx.cnblogs.com
 11//
 12//======================================================================
 13
 14using System;
 15using System.Collections;
 16using System.Collections.Specialized;
 17using System.Data;
 18using System.Data.SqlClient;
 19using System.Configuration;
 20using System.Data.Common;
 21
 22namespace SQLDataBase
 23{
 24    /// <summary>
 25    /// 数据访问基础类(基于SQLServer)
 26    /// </summary>

 27    class SQLDataBase
 28    {
 29        protected static string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
 30        public SQLDataBase()
 31        {
 32
 33        }

 34
 35        执行简单SQL语句
176
177        执行带参数的SQL语句
343
344        存储过程操作
496
497    }

498}

499
posted @ 2008-05-21 10:20  侯垒  阅读(3085)  评论(6编辑  收藏  举报
Powered by: holly