摘要: public ActionResult Index(int id = 1, string Keyword = ""){ViewBag.Page_Count = 10;ViewBag.CurrentPageSize = id;ViewBag.pageIndex = id;ViewBag.KeyName = Keyword;ViewBag.Keyword = "&&keyword=" + Keyword;List model = null ;if (Keyword.Length > 0){model = db.userinfo.Wher 阅读全文
posted @ 2013-07-04 11:16 放哨De老鼠 阅读(569) 评论(0) 推荐(0) 编辑
摘要: EF中使用语句 或存储过程 查询1、无参数查询var model = db.Database.SqlQuery("select* from UserInfoes ").ToList();2、有参查询var model = db.Database.SqlQuery("select* from UserInfoes where id=@ID ",new SqlParameter("@ID",id)).ToList();3、结合linq查询var model = (from p in db.userinfo.SqlQuery("s 阅读全文
posted @ 2013-07-04 11:09 放哨De老鼠 阅读(546) 评论(0) 推荐(0) 编辑