测试CSFramework.DB数据底层组件IDatabase.GetTop方法(Mssql/MySql)
测试CSFramework.DB数据底层组件IDatabase.GetTop方法(Mssql/MySql)
测试案例:
扫一扫加作者微信
测试案例:
C# Code:
private void button23_Click(object sender, EventArgs e)
{
IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text);
//测试GetTop方法, 默认参数
DataTable dt = db.GetTop(100, "sys_Log", "", null, "");
ShowResult($"list={dt.Rows.Count}");
//测试GetTop方法 - 传入指定参数
DbParameter p1 = db.CreateParameter("TableName", "tb_POs");
List<DbParameter> list = new List<DbParameter>();
list.Add(p1);
DataTable dt1 = db.GetTop(100, "sys_Log", "isid,LogUser,LogDate,TableName", list, "isid DESC");
ShowResult($"list={dt1.Rows.Count}");
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = dt1;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
{
IDatabase db = DatabaseFactory.CreateDatabase(_DatabaseType, txtConn.Text);
//测试GetTop方法, 默认参数
DataTable dt = db.GetTop(100, "sys_Log", "", null, "");
ShowResult($"list={dt.Rows.Count}");
//测试GetTop方法 - 传入指定参数
DbParameter p1 = db.CreateParameter("TableName", "tb_POs");
List<DbParameter> list = new List<DbParameter>();
list.Add(p1);
DataTable dt1 = db.GetTop(100, "sys_Log", "isid,LogUser,LogDate,TableName", list, "isid DESC");
ShowResult($"list={dt1.Rows.Count}");
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = dt1;
}
//来源:C/S框架网 | www.csframework.com | QQ:23404761
扫一扫加作者微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网