当前位置: 首页>>代码示例>>C#>>正文


C# Database.ExecuteDataSet方法代码示例

本文整理汇总了C#中Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet方法的典型用法代码示例。如果您正苦于以下问题:C# Database.ExecuteDataSet方法的具体用法?C# Database.ExecuteDataSet怎么用?C# Database.ExecuteDataSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Microsoft.Practices.EnterpriseLibrary.Data.Database的用法示例。


在下文中一共展示了Database.ExecuteDataSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataTableQuery

 /// <summary>
 /// 执行查询语句,返回DataTable
 /// </summary>
 /// <param name="dc">查询语句</param>
 /// <param name="db">操作目标数据库</param>
 /// <returns>DataTable</returns>
 public static DataTable DataTableQuery(DbCommand dc, Database db)
 {
     DataSet ds = new DataSet();
     DataTable dt = new DataTable();
     try
     {
         PrepareCommand(ref dc, db);
         ds = db.ExecuteDataSet(dc);
         if (ds.Tables.Count > 0)
         {
             dt = ds.Tables[0];
             ds.Dispose();
             ds = null;
         }
         else
         {
             ds.Dispose();
             ds = null;
             return null;
         }
     }
     catch (System.Exception e)
     {
         throw new Exception(e.Message);
     }
     return dt;
 }
开发者ID:uwitec,项目名称:O2O,代码行数:33,代码来源:DbHelper.cs

示例2: ExecuteDataSet

 /// <summary>
 /// 获取一个DataSet数据集
 /// </summary>
 /// <param name="cmdType">命令类型,SQL文本或存储过程</param>
 /// <param name="cmdText">SQL语句或存储过程名称</param>
 /// <param name="paras">查询参数</param>
 /// <returns>DataSet数据集</returns>
 public static DataSet ExecuteDataSet(Database db, DbTransaction dbTransaction, CommandType cmdType, string cmdText, params DbParameter[] paras)
 {
     DbCommand dbcmd = GetDbCommand(db, cmdType, cmdText);
     PrepareDbCommand(dbcmd, paras);
     DataSet ds = db.ExecuteDataSet(dbcmd, dbTransaction);
     return ds;
 }
开发者ID:jerryxi,项目名称:GXP,代码行数:14,代码来源:DBHelper.cs

示例3: GetAll

 public DataSet GetAll(string OrderBy, Database db)
 {
     orderBy = "";
     if (OrderBy.Length > 0) orderBy = " Order By " + OrderBy;
     sqlText="Select ID,ACIKLAMA from SECENEK_TIP "+orderBy;
      			dbComm = db.GetSqlStringCommand(sqlText);
     return db.ExecuteDataSet(dbComm);
 }
开发者ID:bahattinz,项目名称:SeminerKayit-1,代码行数:8,代码来源:SecenekTipDao.cs

示例4: GetAllOperateLogs

        public static DataSet GetAllOperateLogs(Database db)
        {
            string cmdText = string.Format("select * from OperateLog order by Id");
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:OperateLogDataAccess.cs

示例5: GetAllUsers

        public static DataSet GetAllUsers(Database db)
        {
            string cmdText = string.Format("select [userID] as 索引号, [username] as 用户名, [usertypename] as 用户类型, [createdatetime] as 创建时间 from [userinfo] order by [userId]");
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:UserDataAccess.cs

示例6: GetWindowCameraInfoById

        public static DataSet GetWindowCameraInfoById(Database db, int id)
        {
            string cmdText = string.Format("select * from [WindowCameraInfo] where [Id]={0}", id);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:WindowCameraDataAccess.cs

示例7: GetWindowCameraInfoByRowCol

        public static DataSet GetWindowCameraInfoByRowCol(Database db, int row, int col)
        {
            string cmdText = string.Format("select * from [WindowCameraInfo] where [row]={0} and [col]={1}", row, col);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:WindowCameraDataAccess.cs

示例8: GetSystemLogs

        public static DataSet GetSystemLogs(Database db, string filter)
        {
            string cmdText = string.Format("select ID as 索引号, happentime as 发生时间,clientusername as 用户名, systemtypename as 操作类型, content as 内容 from SystemLog {0} order by Id", filter);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:SystemLogDataAccess.cs

示例9: GetAllWindowCameraInfo

        public static DataSet GetAllWindowCameraInfo(Database db)
        {
            string cmdText = string.Format("select * from [WindowCameraInfo] order by [Id]");
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:WindowCameraDataAccess.cs

示例10: GetSystemLogTypes

        public static DataSet GetSystemLogTypes(Database db)
        {
            string cmdText = string.Format("select distinct systemtypename from SystemLog");
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:SystemLogDataAccess.cs

示例11: GetUserInfo

        public static DataSet GetUserInfo(Database db,int userid)
        {
            string cmdText = string.Format("select * from [UserInfo] where [UserId]={0}", userid);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:UserDataAccess.cs

示例12: ExecuteGeneralSplitPageProcedure

        public static DataSet ExecuteGeneralSplitPageProcedure(Database db, string fields,string tables,string condition, string ordercolumn,byte ordertype,string pkcolumn,int pageno,int pagesize)
        {
            string cmdText = string.Format("exec GeneralSplitPageProcedure {0},'{1}','{2}','{3}','{4}',{5},'{6}',{7}", pageno, fields, tables, condition, ordercolumn, ordertype, pkcolumn, pagesize);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:CommonDataAccess.cs

示例13: GetAllDeviceInfo

        public static DataSet GetAllDeviceInfo(Database db)
        {
            string cmdText = string.Format("select * from DeviceInfo order by DeviceId");
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);
            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:13,代码来源:DeviceDataAccess.cs

示例14: GetCapturePicture

        public static DataSet GetCapturePicture(Database db, int cameraId, DateTime dt)
        {
            string cmdText = string.Format("select * from CapturePicture where CameraID={0} and Datetime={1}", cameraId,dt);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:14,代码来源:CapturePictureDataAccess.cs

示例15: GetGroupInfoByGroupName

        public static DataSet GetGroupInfoByGroupName(Database db, string groupName)
        {
            string cmdText = string.Format("select * from GroupInfo where Name='{0}' ", groupName);
            try
            {
                return db.ExecuteDataSet(CommandType.Text, cmdText);

            }
            catch (Exception ex)
            {

                throw ex;
            }
        }
开发者ID:dalinhuang,项目名称:intvideosurv,代码行数:14,代码来源:GroupDataAccess.cs


注:本文中的Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteDataSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。