一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

给你个例子[.NET中三层构架开发实例 - 用户注册系统]

时间:2008-01-12 编辑:简简单单 来源:一聚教程网

数据库基类
using System;
using System.Data;
using System.Data.SqlClient;
namespace HaiSky.HtJob
{
    ///
    /// DbClass 的摘要说明。
    ///

    public class DbClass
    {
        private string connectionString;
        protected SqlConnection Connection;
        public DbClass(string newConnectionString)
        {
            connectionString = newConnectionString;
            Connection = new SqlConnection(connectionString);
        }
        public string ConnectionString
        {
            get
            {
                return connectionString;
            }
        }
        private SqlCommand BuildQueryCommand(string storedProcName,IDataParameter[] parameters)
        {
            SqlCommand command = new SqlCommand(storedProcName,Connection);
            command.CommandType = CommandType.StoredProcedure;

热门栏目