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
14
using System;
15
using System.Collections;
16
using System.Collections.Specialized;
17
using System.Data;
18
using System.Data.SqlClient;
19
using System.Configuration;
20
using System.Data.Common;
21
22
namespace 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
(作者:侯垒)













浙公网安备 33010602011771号