• 大小: 2.29MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-03-13
  • 语言: 其他
  • 标签: 权限管理  

资源简介

权限管理系统源码权限管理系统源码权限管理系统源码权限管理系统源码

资源截图

代码片段和文件信息

/**************************************
* 作用: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();
                    }
                }
      

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

     文件       4945  2007-07-18 09:38  from.gif

     文件       4338  2009-04-06 15:57  RedGlovePermission.sln

     文件        125  2007-03-27 14:33  最新Asp.Net源码下载.url

     文件    3145728  2009-04-07 09:29  DB_51aspx\SystemDatabase.mdf

     文件    1048576  2009-04-07 09:29  DB_51aspx\SystemDatabase_log.ldf

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

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

     文件      91648  2009-04-07 09:18  RedGlove.DBUtility\bin\Debug\RedGlove.DBUtility.pdb

     文件      31608  2009-04-07 09:28  RedGlove.DBUtility\MySqlHelper.cs

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

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

     文件      91648  2009-04-07 09:18  RedGlove.DBUtility\obj\Debug\RedGlove.DBUtility.pdb

     文件       6499  2009-04-07 09:18  RedGlove.DBUtility\obj\Debug\ResolveAssemblyReference.cache

     文件      22384  2009-04-06 15:57  RedGlove.DBUtility\OleDBHelper.cs

     文件      21678  2009-04-06 15:57  RedGlove.DBUtility\OracleHelper.cs

     文件       1419  2009-04-06 15:57  RedGlove.DBUtility\Properties\AssemblyInfo.cs

     文件       2717  2009-04-06 15:57  RedGlove.DBUtility\RedGlove.DBUtility.csproj

     文件      29305  2009-04-06 15:57  RedGlove.DBUtility\SqlServerHelper.cs

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

     文件      50688  2009-04-07 09:18  RedGlove.Lib\bin\Debug\RedGlove.Lib.pdb

     文件       3306  2009-04-06 15:57  RedGlove.Lib\ConfigHelper.cs

     文件       1667  2009-04-06 15:57  RedGlove.Lib\DataCache.cs

     文件       6889  2009-04-06 15:57  RedGlove.Lib\Jscript.cs

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

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

     文件      50688  2009-04-07 09:18  RedGlove.Lib\obj\Debug\RedGlove.Lib.pdb

     文件       1416  2009-04-06 15:57  RedGlove.Lib\Properties\AssemblyInfo.cs

     文件       2571  2009-04-06 15:57  RedGlove.Lib\RedGlove.Lib.csproj

     文件        933  2009-04-06 15:57  RedGlove.Lib\RedGlovePermission.Lib.sln

     文件       3317  2009-04-06 15:57  RedGlove.Lib\SecurityEncryption.cs

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

评论

共有 条评论