• 大小: 1.03MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-08-29
  • 语言: ASP
  • 标签:

资源简介

用CodeSmith 生成的项目文件和框架 
网站可免费发布游戏。支持会员和在线购买会员功能,和自动发邮件的设置
有经验和积分管理
界面简介美观。
用户名和密码分别人test@51aspx.com ;51aspx

资源截图

代码片段和文件信息

/**
Company:
Name: Access数据库访问助手类
Author: lihaibo
DateTime: 2009-5-7 16:23:22
*/

using System;
using System.Collections.Generic;
using System.Text;

using System.Data;
using System.Data.OleDb;
using System.Configuration;

namespace AccessDAL
{
    public class AccessHelper
    {
//连接字符串
        private static string StrCon = ConfigurationManager.ConnectionStrings[“Access“].ConnectionString;

#region 查询返回OleDbDataReader
        public static OleDbDataReader GetReader(string sql OleDbParameter[] parms)
        {
OleDbConnection con = new OleDbConnection(StrCon);            
            OleDbCommand com = new OleDbCommand(sql con);
            com.CommandType = CommandType.Text;
            if (parms != null)
            {
                com.Parameters.AddRange(parms);
            }
con.Open();
            OleDbDataReader reader = com.ExecuteReader(CommandBehavior.CloseConnection);
//此处不能关con用完时记得关闭reader
            com.Parameters.Clear();
            return reader;
        }
//重载
        public static OleDbDataReader GetReader(string sql)
        {
            return GetReader(sql null);
        }
#endregion

#region 查询返回DataSet
        public static DataSet GetDataSet(string sql OleDbParameter[] parms)
        {
            DataSet ds = new DataSet();   
                try
                {
using (OleDbConnection con = new OleDbConnection(StrCon))
             {
OleDbCommand com = new OleDbCommand(sql con);
com.CommandType = CommandType.Text;
if (parms != null)
{
com.Parameters.AddRange(parms);
}
OleDbDataAdapter adapter = new OleDbDataAdapter(com); 
con.Open();
adapter.Fill(ds);
com.Parameters.Clear();     
con.Close();                
                 } 
}
                catch (Exception e)
                {
                    string ex = e.Message;
                }           
            return ds;
        }
//重载
        public static DataSet GetDataSet(string sql)
        {
            return GetDataSet(sql null);
        }
#endregion

#region 增、删、改
        public static int ExcuteSQL(string sql OleDbParameter[] parms)
        {
            int rows = -1;            
                try
                {
using (OleDbConnection con = new OleDbConnection(StrCon))
{                   
OleDbCommand com = new OleDbCommand(sqlcon);
com.CommandType = CommandType.Text;
if (parms != null)
{
com.Parameters.AddRange(parms);
}
con.Open();
rows = com.ExecuteNonQuery();
com.Parameters.Clear();      
con.Close();               
                 }
}
catch (Exception e)
                {
                    string ex = e.Message;
                }            
            return rows ;
        }
//重载
        public static int ExcuteSQL(string s

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

     文件       4259  2009-06-10 22:38  youxifabu\AccessDAL\AccessDAL.csproj

     文件       5186  2009-05-31 16:28  youxifabu\AccessDAL\AccessHelper.cs

     文件      34816  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\AccessDAL.dll

     文件      71168  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\AccessDAL.pdb

     文件      17920  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\Config.dll

     文件      42496  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\Config.pdb

     文件       6144  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\Email.dll

     文件      17920  2009-06-18 11:16  youxifabu\AccessDAL\bin\Debug\Email.pdb

     文件       6656  2009-06-18 00:48  youxifabu\AccessDAL\bin\Debug\IDAL.dll

     文件       7680  2009-06-18 00:48  youxifabu\AccessDAL\bin\Debug\IDAL.pdb

     文件      20992  2009-06-16 16:16  youxifabu\AccessDAL\bin\Debug\Models.dll

     文件     103936  2009-06-16 16:16  youxifabu\AccessDAL\bin\Debug\Models.pdb

     文件      33792  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\AccessDAL.dll

     文件      58880  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\AccessDAL.pdb

     文件      16384  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Config.dll

     文件      34304  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Config.pdb

     文件       6144  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Email.dll

     文件      15872  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Email.pdb

     文件       7168  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\IDAL.dll

     文件       7680  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\IDAL.pdb

     文件      19456  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Models.dll

     文件      87552  2009-08-17 10:05  youxifabu\AccessDAL\bin\Release\Models.pdb

     文件       2351  2009-05-07 19:12  youxifabu\AccessDAL\obj\AccessDAL.csproj.FileListAbsolute.txt

     文件        850  2009-06-12 21:59  youxifabu\AccessDAL\obj\Debug\AccessDAL.csproj.FileListAbsolute.txt

     文件        789  2009-06-03 21:39  youxifabu\AccessDAL\obj\Debug\AccessDAL.csproj.GenerateResource.Cache

     文件      34816  2009-06-18 11:16  youxifabu\AccessDAL\obj\Debug\AccessDAL.dll

     文件      71168  2009-06-18 11:16  youxifabu\AccessDAL\obj\Debug\AccessDAL.pdb

     文件        180  2009-06-18 11:16  youxifabu\AccessDAL\obj\Debug\AccessDAL.Properties.Resources.resources

     文件       7680  2009-06-16 10:18  youxifabu\AccessDAL\obj\Debug\Refactor\AccessDAL.dll

     文件      12554  2009-06-18 11:16  youxifabu\AccessDAL\obj\Debug\ResolveAssemblyReference.cache

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

评论

共有 条评论

相关资源