摘要: “System.NullReferenceException”类型的异常在 App_Web_zo44wdaq.dll 中发生,但未在用户代码中进行处理其他信息: 未将对象引用设置到对象的实例。 解决问题: return View( 这里不能为空 ); 为空时:用ViewBag.属性 ViewData 阅读全文
posted @ 2016-12-20 16:55 阿Q啊 阅读(2425) 评论(0) 推荐(0) 编辑
摘要: 找半天才找到 ef添加数据时出错原因:数据库表中没有主键 ,就算表中有自增列 Added方法也会报错; - this._db.SaveChanges() “this._db.SaveChanges()”引发了“System.Data.Entity.Infrastructure.DbUpdateCon 阅读全文
posted @ 2016-12-20 16:33 阿Q啊 阅读(1049) 评论(0) 推荐(0) 编辑
摘要: List<tBaseRolerMapPower> list =new List<tBaseRolerMapPower>() string strName = string.Empty; foreach (tBaseRolerMapPower item in list) { strName += it 阅读全文
posted @ 2016-12-17 14:59 阿Q啊 阅读(435) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 实体查询 /// </summary> public IEnumerable<TEntity> GetSearchList(System.Linq.Expressions.Expression<Func<TEntity, bool>> where) { if (w 阅读全文
posted @ 2016-12-17 13:32 阿Q啊 阅读(1508) 评论(1) 推荐(0) 编辑
摘要: //默认为: Database.SetInitializer<testContext>(null);//这里报错, 检查原因:catch(Exception ex) 错误提示: 基础连接未打开open 数据库 还有另外的原因,网上查到分享给大家 策略一:数据库不存在时重新创建数据库 复制内容到剪贴板 阅读全文
posted @ 2016-12-17 13:28 阿Q啊 阅读(4108) 评论(0) 推荐(0) 编辑