上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 36 下一页
摘要: EF context.SaveChanges()特点1 一次连接保存多条数据(工作单元模式);2 内部通过事务来执行,如果一条数据保存失败,执行回滚操作;3 延时加载var userList=from u in context.UserInfo select u;fo... 阅读全文
posted @ 2018-06-15 09:39 dxm809 阅读(186) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ModelFirst{ ... 阅读全文
posted @ 2018-06-15 09:33 dxm809 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 1 新建实体数据模型 ,选择空模型2 建各个实体,并指定各字段属性,字符串需要指定长度3 添加关系,选择关系类型,勾选添加外键4 新建空的数据库,然后在edmx文件的空白处点右键,选择从模型生成数据库,选择刚建的数据库,生成sql文件,点击上面的运行按钮,即可生成数据... 阅读全文
posted @ 2018-06-15 09:05 dxm809 阅读(85) 评论(0) 推荐(0) 编辑
摘要: UserInfo user = from u in context.UserInfo where u.Id=343 select u;context.UserInfo.Remove(user); 用Remove()方法时,必须先从EF中查到才能删除UserInfo u... 阅读全文
posted @ 2018-06-14 17:49 dxm809 阅读(115) 评论(0) 推荐(0) 编辑
摘要: Winform 里有 Application.DoEvents();可刷新!WPF 里没这个,尽管可用委托实现多线程,但是刷新还是不行!后来找到了 类似App.DoEvents()的方法();代码:using System;using System.Collectio... 阅读全文
posted @ 2018-06-13 10:59 dxm809 阅读(335) 评论(0) 推荐(0) 编辑
摘要: Asp.Net MVC+EF+三层架构的完整搭建过程架构图:使用的数据库:一张公司的员工信息表,测试数据解决方案项目设计:1.新建一个空白解决方案名称为Company2.在该解决方案下,新建解决方案文件夹(UI,BLL,DAL,Model) 当然还可以加上common... 阅读全文
posted @ 2018-06-02 08:40 dxm809 阅读(852) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Text;... 阅读全文
posted @ 2018-05-30 10:41 dxm809 阅读(167) 评论(0) 推荐(0) 编辑
摘要: @{ Layout = null;} Index ... 阅读全文
posted @ 2018-05-30 10:17 dxm809 阅读(146) 评论(0) 推荐(0) 编辑
摘要: @{ Layout = null;} Index 60% 0% 2% ... 阅读全文
posted @ 2018-05-30 10:17 dxm809 阅读(83) 评论(0) 推荐(0) 编辑
摘要: @{ Layout = null;} Index Media... 阅读全文
posted @ 2018-05-30 10:17 dxm809 阅读(111) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 36 下一页