本文整理汇总了C#中QueryBuilder.generateDbParam方法的典型用法代码示例。如果您正苦于以下问题:C# QueryBuilder.generateDbParam方法的具体用法?C# QueryBuilder.generateDbParam怎么用?C# QueryBuilder.generateDbParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.generateDbParam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoChotBangChamCong
public void MoChotBangChamCong(DateTime []dsNgayMoChot,string TableName)
{
//foreach (DateTime item in dsNgayMoChot)
//{
// DOChot info = new DOChot { Ngay = item };
// MoChot(info,TableName);
//}
QueryBuilder query = new QueryBuilder("DELETE FROM " + DAChamCongAutoChot.TABLE_MAP + " WHERE 1=1");
query.addDateFromTo("NGAY", dsNgayMoChot[0], dsNgayMoChot[dsNgayMoChot.Length - 1]);
DatabaseFB db = HelpDB.getDatabase();
DbCommand cmd = db.GetSQLStringCommand(query.generateParamSQL());
cmd.Parameters.AddRange(query.generateDbParam().ToArray());
db.ExecuteNonQuery(cmd);
}
示例2: frmHopDong_Load
private void frmHopDong_Load(object sender, EventArgs e)
{
QueryBuilder query = new QueryBuilder("delete from LOAI_DANH_BA where 1=1");
query.addID("ID", 10110);
DBService db = new DABaseFb().SQLStmt;
db.Begin();
try
{
db.DbCommand.Parameters.AddRange(query.generateDbParam().ToArray());
db.ExecuteCommand(query.generateParamSQL());
db.Commit();
}
catch (Exception ex)
{
db.RollBack();
}
}
示例3: LoadDataSet
/// <summary>
/// Lấy dữ liệu từ chuỗi Sql được dựng từ QueryBuilder
/// </summary>
public bool LoadDataSet(DataSet ds, QueryBuilder query, string tableName)
{
if (ds == null) return false;
if (tableName == null) tableName = "NO_NAME";
try
{
m_cmd.CommandText = query.generateParamSQL();
m_cmd.Parameters.AddRange(query.generateDbParam("PL").ToArray());
LoadDataSet(ds, tableName);
return true;
}
catch
{
return false;
}
finally { }
}