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


C# DbConn.SqlToDataSet方法代码示例

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


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

示例1: Get

 public virtual List<tb_shuntruleconn_config_model> Get(DbConn PubConn,DateTime lastUpdateTime)
 {
     return XXF.ProjectTool.SqlHelper.Visit(ps =>
     {
         List<ProcedureParameter> Par = new List<ProcedureParameter>();
         StringBuilder stringSql = new StringBuilder();
         if (lastUpdateTime == default(DateTime))
         {
             stringSql.Append(@"select s.* from tb_distribution_rule_config s");
         }
         else
         {
             stringSql.Append(@"select s.* from tb_distribution_rule_config s where s.f_last_update_time>[email protected]");
             ps.Add("lastTime", lastUpdateTime);
         }
       //      int rev = PubConn.ExecuteSql(stringSql.ToString(), ps.ToParameters());
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), ps.ToParameters());
         var rs = new List<tb_shuntruleconn_config_model>();
         if (ds != null && ds.Tables.Count > 0)
         {
             foreach (DataRow dr in ds.Tables[0].Rows)
             {
                 var r = CreateModel(dr);
                 rs.Add(r);
             }
         }
         return rs;
     });
 }
开发者ID:buweixiaomi,项目名称:DydCert,代码行数:30,代码来源:tb_shuntruleconn_config_dal.cs

示例2: GetByTaskID

 public tb_tempdata_model GetByTaskID(DbConn PubConn, int taskid)
 {
     return SqlHelper.Visit(ps =>
     {
         ps.Add("taskid", taskid);
         string sql = "select * from tb_tempdata where [email protected]";
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, sql, ps.ToParameters());
         tb_tempdata_model model = CreateModel(ds.Tables[0].Rows[0]);
         return model;
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:12,代码来源:tb_tempdata_dal.cs

示例3: Get

        public virtual tb_node_model Get(DbConn PubConn, int id)
        {
            List<ProcedureParameter> Par = new List<ProcedureParameter>();
            Par.Add(new ProcedureParameter("@id", id));
            StringBuilder stringSql = new StringBuilder();
            stringSql.Append(@"select s.* from tb_node s where [email protected]");
            DataSet ds = new DataSet();
            PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
				return CreateModel(ds.Tables[0].Rows[0]);
            }
            return null;
        }
开发者ID:zeus911,项目名称:Dyd.BaseService.TaskManager,代码行数:14,代码来源:tb_node_dal.cs

示例4: GetByPartitionID

 public virtual tb_mqpath_model GetByPartitionID(DbConn PubConn, int partitionid)
 {
     List<ProcedureParameter> Par = new List<ProcedureParameter>();
     Par.Add(new ProcedureParameter("@partitionid", partitionid));
     StringBuilder stringSql = new StringBuilder();
     stringSql.Append(@"select m.* from tb_mqpath_partition s,tb_mqpath m WITH(NOLOCK) where [email protected] and s.mqpathid=m.id");
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         return CreateModel(ds.Tables[0].Rows[0]);
     }
     return null;
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:14,代码来源:tb_mqpath_dal.cs

示例5: Get2

 public virtual string Get2(DbConn PubConn, string key)
 {
     List<ProcedureParameter> Par = new List<ProcedureParameter>();
     Par.Add(new ProcedureParameter("@key", key));
     StringBuilder stringSql = new StringBuilder();
     stringSql.Append(@"select value from tb_config s WITH(NOLOCK) where s.[key][email protected]");
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         return Convert.ToString(ds.Tables[0].Rows[0][0]);
     }
     return null;
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:14,代码来源:tb_config_dal.cs

示例6: GetByTempId

 public virtual tb_consumer_model GetByTempId(DbConn PubConn, long tempid)
 {
     List<ProcedureParameter> Par = new List<ProcedureParameter>();
     Par.Add(new ProcedureParameter("@tempid", tempid));
     StringBuilder stringSql = new StringBuilder();
     stringSql.Append(@"select s.* from tb_consumer s  WITH(NOLOCK)  where [email protected]");
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         return CreateModel(ds.Tables[0].Rows[0]);
     }
     return null;
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:14,代码来源:tb_consumer_dal.cs

示例7: List

 public virtual List<tb_config_model> List(DbConn PubConn)
 {
     List<ProcedureParameter> Par = new List<ProcedureParameter>();
     StringBuilder stringSql = new StringBuilder();
     stringSql.Append(@"select s.* from tb_config s WITH(NOLOCK)");
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
     List<tb_config_model> rs = new List<tb_config_model>();
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         foreach (DataRow dr in ds.Tables[0].Rows)
             rs.Add(CreateModel(dr));
     }
     return rs;
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:15,代码来源:tb_config_dal.cs

示例8: GetMaxCommandID

 public int GetMaxCommandID(DbConn PubConn)
 {
     return SqlHelper.Visit(ps =>
     {
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select max(id) from tb_command s ");
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), ps.ToParameters());
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
           return Convert.ToInt32(ds.Tables[0].Rows[0][0]);
         }
         return 0;
     });
 }
开发者ID:zeus911,项目名称:Dyd.BaseService.TaskManager,代码行数:15,代码来源:tb_command_dal.cs

示例9: GetTempData

 public virtual string GetTempData(DbConn PubConn, int taskid)
 {
     return SqlHelper.Visit(ps =>
     {
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select s.* from tb_tempdata s where [email protected]");
         ps.Add("taskid", taskid);
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), ps.ToParameters());
         if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             return Convert.ToString( ds.Tables[0].Rows[0]["tempdatajson"]);
         }
         return null;
     });
 }
开发者ID:zeus911,项目名称:Dyd.BaseService.TaskManager,代码行数:16,代码来源:tb_tempdata_dal.cs

示例10: GetByClient

 public virtual tb_consumer_client_model GetByClient(DbConn PubConn, string client)
 {
     return SqlHelper.Visit((ps) =>
     {
         ps.Add("@client", client);
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select top 1 s.* from tb_consumer_client s WITH(NOLOCK) where [email protected]");
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), ps.ToParameters());
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             return CreateModel(ds.Tables[0].Rows[0]);
         }
         return null;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:16,代码来源:tb_consumer_client_dal.cs

示例11: Get

 public virtual tb_mqpath_model Get(DbConn PubConn, string mqpath)
 {
     return SqlHelper.Visit((ps) => {
         List<ProcedureParameter> Par = new List<ProcedureParameter>();
         Par.Add(new ProcedureParameter("@mqpath", mqpath));
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select s.* from tb_mqpath s WITH(NOLOCK) where [email protected]");
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             return CreateModel(ds.Tables[0].Rows[0]);
         }
         return null;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:16,代码来源:tb_mqpath_dal.cs

示例12: CheckMaxPartitionIndexOfMqPathIsRunning

 public bool CheckMaxPartitionIndexOfMqPathIsRunning(DbConn PubConn, int mqpathid)
 {
     List<ProcedureParameter> Par = new List<ProcedureParameter>();
     Par.Add(new ProcedureParameter("@mqpathid", mqpathid));
     Par.Add(new ProcedureParameter("@state", (int)XXF.BaseService.MessageQuque.BusinessMQ.SystemRuntime.EnumMqPathPartitionState.Running));
     StringBuilder stringSql = new StringBuilder();
     stringSql.Append(@"select top 1 id from tb_mqpath_partition s WITH(NOLOCK)  where [email protected] and partitionindex = (select max(partitionindex) from tb_mqpath_partition s WITH(NOLOCK)  where [email protected]) and [email protected]");
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
     if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
     {
         if (ds.Tables[0].Rows[0][0] is DBNull)
             return false;
         return true;
     }
     return true;
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:17,代码来源:tb_mqpath_partition_dal.cs

示例13: GetCurrentVersion

 public virtual tb_version_model GetCurrentVersion(DbConn PubConn, int taskid,int version)
 {
     return SqlHelper.Visit(ps =>
     {
         ps.Add("@taskid", taskid);
         ps.Add("@version", version);
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select s.* from tb_version s where [email protected] and [email protected]");
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), ps.ToParameters());
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count>0)
         {
             return CreateModel(ds.Tables[0].Rows[0]);
         }
         return null;
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:17,代码来源:tb_version_dal.cs

示例14: Get2

 public virtual tb_datanode_model Get2(DbConn PubConn, int datanodepartition)
 {
     return SqlHelper.Visit((ps) =>
     {
         List<ProcedureParameter> Par = new List<ProcedureParameter>();
         Par.Add(new ProcedureParameter("@datanodepartition", datanodepartition));
         StringBuilder stringSql = new StringBuilder();
         stringSql.Append(@"select s.* from tb_datanode s WITH(NOLOCK) where [email protected]");
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, stringSql.ToString(), Par);
         if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
         {
             return CreateModel(ds.Tables[0].Rows[0]);
         }
         return null;
     });
 }
开发者ID:xwx2015,项目名称:MQ,代码行数:17,代码来源:tb_datanode_dal.cs

示例15: GetUserName

 public tb_user_model GetUserName(DbConn PubConn, string userstaffno)
 {
     return SqlHelper.Visit(ps =>
     {
         ps.Add("userstaffno", userstaffno);
         string sql = "select id,username,userrole from tb_user where [email protected]";
         DataSet ds = new DataSet();
         PubConn.SqlToDataSet(ds, sql, ps.ToParameters());
         if (ds.Tables[0].Rows.Count > 0)
         {
             tb_user_model m = CreateModel(ds.Tables[0].Rows[0]);
             return m;
         }
         else
             return null;
     });
 }
开发者ID:houzhenggang,项目名称:Dyd.BaseService.TaskManager,代码行数:17,代码来源:tb_user_dal.cs


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