Subsonic 执行存储过程,执行sql语句
//存储过程 SubSonic.Schema.StoredProcedure sp = new SubSonic.Schema.StoredProcedure("fenye"); sp.Command.AddParameter("@Id", "1"); sp.Command.AddOutputParameter("@Id"); sp.Command.AddReturnParameter();...
View ArticleSubsonic 增删改
增 DAL.User uModel = new DAL.User(); uModel.UserName = string.Format("{0}{1}", u.UserName, i); uModel.Expire = DateTime.Now; uModel.Password = string.Empty; uModel.Save(); //方式2 new...
View ArticleSubsonic 复杂查询(动态条件) 连表、分页
SqlQuery query = new Select(DAL.UsersTable.IdColumn,"UserName") .From().LeftInnerJoin(DAL.UsersTable.IdColumn,DAL.UsersTable.IdColumn) .Where(DAL.UsersTable.IdColumn).IsGreaterThan(0); //添加条件...
View ArticleSubsonic3.0 使用TransactionScope 方法
在官网中的方法是错的 官网的 using (SharedDbConnectionScope sharedConnectionScope = new SharedDbConnectionScope()){ using (TransactionScope ts = new TransactionScope()) { Product p = new...
View Article[转]Subsonic: Code-First开发模式
一直以来都在使用数据驱动的开发模式:PD设计数据库模型,然后生成数据库脚本,再然后建立数据库(可能还要写段SQL脚本初始化一点数据),再然后用上个ORM框架,最后开始狂写代码。 实在太枯燥,太麻烦啦。...
View Article
More Pages to Explore .....