本文整理汇总了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;
});
}
示例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;
});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
});
}
示例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;
});
}
示例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;
});
}
示例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;
});
}
示例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;
}
示例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;
});
}
示例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;
});
}
示例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;
});
}