IList<UserInfo> aa= DB.Select().Top("5").From(UserInfo.Schema).ExecuteTypedList<UserInfo>();
//返回 UserInfoCollection
UserInfoCollection users = new UserInfoCollection().Where(UserInfo.Columns.Password, SubSonic.Comparison.Equals, "admin").Load();
//返回单个对象
UserInfo user = new UserInfo("password", "demo");
//返回单个对象
UserInfo aa = DB.Select().Top("5").From(UserInfo.Schema).ExecuteSingle<UserInfo>();
UserInfo aa = DB.Select().Top("5").From<UserInfo>().ExecuteSingle<UserInfo>();
//删除记录
UserInfo.Delete(UserInfo.Columns.Username, "demo");
//更新
DAL.TaxItem.Query().WHERE("xMCode=" + xMCode + "").AddUpdateSetting("ValueItem", ValueItem).Execute();
//插入记录
UserInfo.Insert("aa", "bb", null, null, null, null, null, "abc", "abc");
Object q = DAL.S35.Query().WHERE("ProClass=" + ysgxmodel.Flag).GetSum(ysgxmodel.Zdmc);
//链接查询,From的表,==InnerJoin的第二张表 位置 位置
IDataReader res = DB.Select("address" ,"trade_code", "Name","code" ).From<CompanyTrade>().InnerJoin(CompanyInformation.TradeCodeColumn, CompanyTrade.IdColumn).ExecuteReader();
DataTable dt = new DataTable();
dt.Load(res);
this.dataGridView1.DataSource = dt;
subnoic直接执行sql语句
new InlineQuery().ExecuteReader(sql)
把有or的表达式单独定在InnerWhere里头
//tab为表名,如果存在返回true,否则返 回false
int i = Convert.ToInt16(db.ExecuteScalar("SELECT Count(*) AS RTab FROM MSysObjects WHERE (MSysObjects.Name) Like '"+tab+"'"));
if (i == 0)
{
return false;
}
else
{
return true;
}
}