• 大小: 1.32MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: 其他
  • 标签: 毕业设计  

资源简介

管理员登录 员工登陆 后台管理客户信息 商品信息 员工资料

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace ClassLibrary1
{
    class DBHelper
    {
        private static SqlConnection _conn;
        public static SqlConnection Conn
        {
            get
            {
                string connstr = ConfigurationManager.ConnectionStrings[“connstr“].ConnectionString;
                if (_conn == null)
                {
                    _conn = new SqlConnection(connstr);
                    _conn.Open();
                }
                else if (_conn.State == ConnectionState.Closed)
                {
                    _conn.Open();
                }
                else if (_conn.State == ConnectionState.Broken)
                {
                    _conn.Close();
                    _conn.Open();
                }
                return _conn;
            }
        }
        /// 
        /// 执行插入/更新/删除
        /// 

        /// 
        public static int ExecuteCommand(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);
            int count = cmd.ExecuteNonQuery();
            return count;
        }
        /// 
        /// 执行查询以连接的方式
        /// 

        /// 
        public static SqlDataReader getReader(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);
            SqlDataReader sdr = cmd.ExecuteReader();
            return sdr;
        }
        /// 
        /// 以不连接的方式操作数据库
        /// 

        /// 
        /// 
        public static DataTable getDataSet(string sql)
        {
            SqlDataAdapter sda = new SqlDataAdapter(sql Conn);
            DataTable dt = new DataTable();
            sda.Fill(dt);
            return dt;
        }
        /// 
        /// 返回首行首列的数据
        /// 

        /// 
        /// 
        public static object getScalar(string sql)
        {
            SqlCommand cmd = new SqlCommand(sql Conn);
            object obj = cmd.ExecuteScalar();
            return obj;
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10240  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll

     文件      26112  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.pdb

     文件       7680  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\bin\Debug\lbjMod.dll

     文件      32256  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\bin\Debug\lbjMod.pdb

     文件       2797  2014-04-25 00:44  ClassLibrary1\ClassLibrary1\ClassLibrary1.csproj

     文件       2462  2014-04-16 01:34  ClassLibrary1\ClassLibrary1\DBHelper.cs

     文件        642  2014-04-25 11:30  ClassLibrary1\ClassLibrary1\dengjiService.cs

     文件       2179  2014-04-25 00:17  ClassLibrary1\ClassLibrary1\gonggaoService.cs

     文件       1836  2014-04-25 12:01  ClassLibrary1\ClassLibrary1\jingjiaService.cs

     文件        444  2014-04-25 12:01  ClassLibrary1\ClassLibrary1\jingpianService.cs

     文件        664  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\obj\Debug\ClassLibrary1.csproj.FileListAbsolute.txt

     文件      10240  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\obj\Debug\ClassLibrary1.dll

     文件      26112  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\obj\Debug\ClassLibrary1.pdb

     文件       5921  2014-04-25 16:07  ClassLibrary1\ClassLibrary1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        664  2014-04-20 11:01  ClassLibrary1\ClassLibrary1\obj\Debug\lbjDAL.csproj.FileListAbsolute.txt

     文件       2646  2014-04-25 12:19  ClassLibrary1\ClassLibrary1\obj\Debug\ResolveAssemblyReference.cache

     文件       1376  2014-04-16 00:39  ClassLibrary1\ClassLibrary1\Properties\AssemblyInfo.cs

     文件       3067  2014-04-25 11:26  ClassLibrary1\ClassLibrary1\shenfenService.cs

     文件       2345  2014-04-20 12:02  ClassLibrary1\lbj.sln

    ..A..H.     74752  2014-04-25 16:14  ClassLibrary1\lbj.suo

     文件      10240  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\ClassLibrary1.dll

     文件      26112  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\ClassLibrary1.pdb

     文件       9728  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\lbjBLL.dll

     文件      26112  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\lbjBLL.pdb

     文件       7680  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\lbjMod.dll

     文件      32256  2014-04-25 12:19  ClassLibrary1\lbjBLL\bin\Debug\lbjMod.pdb

     文件       1223  2014-04-25 10:39  ClassLibrary1\lbjBLL\dengjibBLL.cs

     文件       2249  2014-04-25 00:17  ClassLibrary1\lbjBLL\gonggaobBLL.cs

     文件       2146  2014-04-25 12:03  ClassLibrary1\lbjBLL\jingjaibBLL.cs

     文件        715  2014-04-25 12:07  ClassLibrary1\lbjBLL\jingpianbBLL.cs

............此处省略236个文件信息

评论

共有 条评论