• 大小: 35KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-02-02
  • 语言: C#
  • 标签: 三层结构  三层  

资源简介

数据库连接典型三层结构,用于初学者了解数据库连接和存储

资源截图

代码片段和文件信息

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

namespace ThreelayerDemo.Core
{
    public class dbConnection
    {
        private SqlDataAdapter myAdapter;
        private SqlConnection conn;

        /// 
        /// Initialise Connection
        /// 

        public dbConnection()
        {
            myAdapter = new SqlDataAdapter();
            conn = new SqlConnection(ConfigurationManager.ConnectionStrings[“dbConnectionString“].ConnectionString);
        }

        /// 
        /// Open Database Connection if Closed or Broken
        /// 

        private SqlConnection openConnection()
        {
            if (conn.St

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-05-31 03:15  ThreelayerDemo\
     目录           0  2009-03-24 01:59  ThreelayerDemo\Code\
     目录           0  2009-06-03 02:03  ThreelayerDemo\Code\ThreelayerDemo\
     文件         368  2009-03-23 23:59  ThreelayerDemo\Code\ThreelayerDemo\app.config
     目录           0  2009-06-03 00:23  ThreelayerDemo\Code\ThreelayerDemo\bin\
     目录           0  2009-06-03 00:29  ThreelayerDemo\Code\ThreelayerDemo\bin\Debug\
     文件       14848  2009-06-03 02:03  ThreelayerDemo\Code\ThreelayerDemo\bin\Debug\ThreelayerDemo.exe
     文件         368  2009-03-23 23:59  ThreelayerDemo\Code\ThreelayerDemo\bin\Debug\ThreelayerDemo.exe.config
     文件       14328  2009-06-03 02:04  ThreelayerDemo\Code\ThreelayerDemo\bin\Debug\ThreelayerDemo.vshost.exe
     文件         368  2009-03-23 23:59  ThreelayerDemo\Code\ThreelayerDemo\bin\Debug\ThreelayerDemo.vshost.exe.config
     目录           0  2009-06-03 01:46  ThreelayerDemo\Code\ThreelayerDemo\BUS\
     文件        1878  2009-06-03 01:46  ThreelayerDemo\Code\ThreelayerDemo\BUS\userBUS.cs
     目录           0  2009-06-03 01:45  ThreelayerDemo\Code\ThreelayerDemo\DAO\
     文件        1725  2009-06-03 01:45  ThreelayerDemo\Code\ThreelayerDemo\DAO\userDAO.cs
     文件        3793  2009-06-03 01:52  ThreelayerDemo\Code\ThreelayerDemo\dbConnection.cs
     文件        1090  2009-06-03 02:03  ThreelayerDemo\Code\ThreelayerDemo\frmLogin.cs
     文件        5230  2009-06-03 01:59  ThreelayerDemo\Code\ThreelayerDemo\frmLogin.Designer.cs
     文件        5814  2009-03-25 23:09  ThreelayerDemo\Code\ThreelayerDemo\frmLogin.resx
     文件         509  2009-03-09 00:53  ThreelayerDemo\Code\ThreelayerDemo\Program.cs
     目录           0  2009-03-23 21:57  ThreelayerDemo\Code\ThreelayerDemo\Properties\
     文件        1440  2009-03-09 00:37  ThreelayerDemo\Code\ThreelayerDemo\Properties\AssemblyInfo.cs
     文件        2857  2009-03-09 00:37  ThreelayerDemo\Code\ThreelayerDemo\Properties\Resources.Designer.cs
     文件        5612  2009-03-09 00:37  ThreelayerDemo\Code\ThreelayerDemo\Properties\Resources.resx
     文件        1649  2009-03-23 21:57  ThreelayerDemo\Code\ThreelayerDemo\Properties\Settings.Designer.cs
     文件         936  2009-03-23 21:57  ThreelayerDemo\Code\ThreelayerDemo\Properties\Settings.settings
     文件        6117  2009-06-03 01:45  ThreelayerDemo\Code\ThreelayerDemo\ThreelayerDemo.csproj
     文件         531  2009-03-23 23:57  ThreelayerDemo\Code\ThreelayerDemo\ThreelayerDemo.csproj.user
     目录           0  2009-06-03 01:45  ThreelayerDemo\Code\ThreelayerDemo\VO\
     文件        1377  2009-06-03 01:45  ThreelayerDemo\Code\ThreelayerDemo\VO\userVO.cs
     文件         932  2009-03-09 00:37  ThreelayerDemo\Code\ThreelayerDemo.sln
     文件       38912  2009-06-03 02:04  ThreelayerDemo\Code\ThreelayerDemo.suo
............此处省略0个文件信息

评论

共有 条评论