-
大小: 1.44MB文件類型: .rar金幣: 1下載: 0 次發(fā)布日期: 2023-10-30
- 語言: 數(shù)據(jù)庫
- 標簽:
資源簡介
基于角色的權(quán)限管理(源碼),解壓后,附加sql server2005數(shù)據(jù)庫可直接運行,vs2008環(huán)境。
代碼片段和文件信息
/**************************************
*?作用:MySql操作實現(xiàn)
*?作者:Nick.Yan
*?日期:?2007-05-24
*?網(wǎng)址: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
????{
????????//數(shù)據(jù)庫連接字符串(web.config來配置),可以動態(tài)更改SQLString支持多數(shù)據(jù)庫.
????????public?static?string?connectionString?=?ConfigurationManager.AppSettings[“SQLString“];
????????public?MySqlHelper(){}
????????#region??執(zhí)行簡單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;
????????????}
????????}
????????///?
????????///?執(zhí)行SQL語句,返回影響的記錄數(shù)
????????///?
????????///?SQL語句
????????///?影響的記錄數(shù)
????????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個文件信息
評論
共有 條評論