• 大小: 1.44MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-30
  • 语言: 数据库
  • 标签:

资源简介

基于角色的权限管理(源码),解压后,附加sql server2005数据库可直接运行,vs2008环境。

资源截图

代码片段和文件信息

/**************************************
* 作用:MySql操作实现
* 作者:Nick.Yan
* 日期: 2007-05-24
* 网址:www.redglove.com.cn
**************************************/
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using MySql.Data.Types;
using MySql.Data.MySqlClient;
//该源码下载自www.51aspx.com(51aspx.com)

namespace RedGlove.DBUtility
{
    /// 
    /// C#操作mysql基类
    /// 

    public abstract class MySqlHelper
    {
        //数据库连接字符串(web.config来配置),可以动态更改SQLString支持多数据库.
        public static string connectionString = ConfigurationManager.AppSettings[“SQLString“];

        public MySqlHelper(){}

        #region  执行简单SQL语句

        public static bool Exists(string strSql)
        {
            object obj = GetSingle(strSql);
            int cmdresult;
            if ((object.Equals(obj null)) || (object.Equals(obj System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        public static bool Exists(string strSql params MySqlParameter[] cmdParms)
        {
            object obj = GetSingle(strSql cmdParms);
            int cmdresult;
            if ((object.Equals(obj null)) || (object.Equals(obj System.DBNull.Value)))
            {
                cmdresult = 0;
            }
            else
            {
                cmdresult = int.Parse(obj.ToString());
            }
            if (cmdresult == 0)
            {
                return false;
            }
            else
            {
                return true;
            }
        }

        /// 
        /// 执行SQL语句,返回影响的记录数
        /// 

        /// SQL语句
        /// 影响的记录数
        public static int ExecuteSql(string SQLString)
        {
            using (MySqlConnection connection = new MySqlConnection(connectionString))
            {
                using (MySqlCommand cmd = new MySqlCommand(SQLString connection))
                {
                    try
                    {
                        connection.Open();
                        cmd.ExecuteNonQuery();
                        int rows = cmd.ExecuteNonQuery();
                        return rows;
                    }
                    catch (MySqlException E)
                    {
                        throw new Exception(E.Message);
                    }
                    finally
                    {
                        cmd.Dispose();
                        connection.Close();
                    }
                }
      

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

     文件        428  2009-04-07 09:18  RedGlovePermission\RedGlove.DBUtility\obj\Debug\RedGlove.DBUtility.csproj.FileListAbsolute.txt

     文件        374  2009-04-07 09:18  RedGlovePermission\RedGlove.Lib\obj\Debug\RedGlove.Lib.csproj.FileListAbsolute.txt

     文件       1208  2009-04-07 09:18  RedGlovePermission\RGP.BLL\obj\Debug\RGP.BLL.csproj.FileListAbsolute.txt

     文件        822  2009-04-07 09:18  RedGlovePermission\RGP.DALFactory\obj\Debug\RGP.DALFactory.csproj.FileListAbsolute.txt

     文件        468  2009-04-07 09:18  RedGlovePermission\RGP.IDAL\obj\Debug\RGP.IDAL.csproj.FileListAbsolute.txt

     文件        347  2009-04-07 09:18  RedGlovePermission\RGP.Model\obj\Debug\RGP.Model.csproj.FileListAbsolute.txt

     文件       1090  2009-04-07 09:18  RedGlovePermission\RGP.SQLserverDAL\obj\Debug\RGP.SQLServerDAL.csproj.FileListAbsolute.txt

     文件        888  2009-04-07 09:18  RedGlovePermission\RGPWEB\obj\Debug\RGPWEB.csproj.FileListAbsolute.txt

     文件        500  2005-12-23 17:10  RedGlovePermission\www.ziyuan8.com资源吧.txt

     文件       1184  2009-04-07 13:34  RedGlovePermission\源码必读.txt

     文件       1308  2004-07-29 08:34  RedGlovePermission\资源吧下载说明.htm

     文件     290816  2009-04-06 15:57  RedGlovePermission\RedGlove.DBUtility\bin\Debug\MySql.Data.dll

     文件     290816  2009-04-06 15:57  RedGlovePermission\RGP.BLL\bin\Debug\MySql.Data.dll

     文件     290816  2009-04-06 15:57  RedGlovePermission\RGP.SQLserverDAL\bin\Debug\MySql.Data.dll

     文件     290816  2009-04-06 15:57  RedGlovePermission\RGPWEB\bin\MySql.Data.dll

     文件      28160  2009-04-07 09:18  RedGlovePermission\RedGlove.DBUtility\bin\Debug\RedGlove.DBUtility.dll

     文件      28160  2009-04-07 09:18  RedGlovePermission\RedGlove.DBUtility\obj\Debug\RedGlove.DBUtility.dll

     文件      28160  2009-04-07 09:18  RedGlovePermission\RGP.BLL\bin\Debug\RedGlove.DBUtility.dll

     文件      28160  2009-04-07 09:18  RedGlovePermission\RGP.SQLserverDAL\bin\Debug\RedGlove.DBUtility.dll

     文件      28160  2009-04-07 09:18  RedGlovePermission\RGPWEB\bin\RedGlove.DBUtility.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RedGlove.Lib\bin\Debug\RedGlove.Lib.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RedGlove.Lib\obj\Debug\RedGlove.Lib.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RGP.BLL\bin\Debug\RedGlove.Lib.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RGP.DALFactory\bin\Debug\RedGlove.Lib.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RGP.SQLserverDAL\bin\Debug\RedGlove.Lib.dll

     文件      22016  2009-04-07 09:18  RedGlovePermission\RGPWEB\bin\RedGlove.Lib.dll

     文件      11776  2009-04-07 09:18  RedGlovePermission\RGP.BLL\bin\Debug\RGP.BLL.dll

     文件      11776  2009-04-07 09:18  RedGlovePermission\RGP.BLL\obj\Debug\RGP.BLL.dll

     文件      11776  2009-04-07 09:18  RedGlovePermission\RGPWEB\bin\RGP.BLL.dll

     文件       5632  2009-04-07 09:18  RedGlovePermission\RGP.BLL\bin\Debug\RGP.DALFactory.dll

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

评论

共有 条评论

相关资源