當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。