上一页 1 2 3 4 5 6 7 8 ··· 18 下一页
摘要: 在网上查阅了众多方案,觉得路过秋天的方案解耦性比较好,可以不使用微软的Resource文件,而是将所有的词汇放入在一个txt的词典之中,便于维护。步骤如下:1)在整个程序的入口处global.asax.cs加入函数 private void ReadDic(string dicFileName) { var dicPath = Path.Combine(Server.MapPath("/File"), dicFileName); string dicStr; using (var fs = new StreamRe... 阅读全文
posted @ 2014-02-11 18:16 瓜王 阅读(1172) 评论(0) 推荐(0) 编辑
摘要: 示例: $(function () { $(document).on('submit', '#FormId', function () { var val = $("#Name").val(); if (val == "") { $(".ColumnNameErrorTxt").hide().eq(0).show(); return false; } if (val.length > 40) { $(".... 阅读全文
posted @ 2014-02-11 17:35 瓜王 阅读(938) 评论(0) 推荐(0) 编辑
摘要: 判断数据库中某个值是否为null(而不是'null',空字符串'',若干个空格' ') 一定不能用=null 或 !=null,而要用is null 或 is not null。在sqlserver中若根据含有null值的列排序,不管这一列是数字类型还是字符串类型,包含null值的行是最小的。 阅读全文
posted @ 2014-01-27 18:06 瓜王 阅读(191) 评论(0) 推荐(0) 编辑
摘要: asp.net mvc4项目部署到II&上时,出现HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory.在web.config的system.webServer节点中 如果这个modules不存在,那么加上就好了。原因是Nuget有时会删除这个节点。参见http://stackoverflow.com/questions/1741439/asp-mvc-in-iis-7-results-in-http-error-403-14-for 阅读全文
posted @ 2014-01-22 14:32 瓜王 阅读(4722) 评论(1) 推荐(0) 编辑
摘要: 默认LINQ to Entities会使用隐式事务,即:对于每一个savechanges都分开在单独的事务之中。也可以显式地指定事务: using (var db = new TestEntities()) { using (TransactionScope ts = new TransactionScope()) { var call1 = db.Call.FirstOrDefault(); call1.Content = "12332... 阅读全文
posted @ 2014-01-17 12:08 瓜王 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 1、首先在数据库中创建好存储过程。 2、在实体模型中添加存储过程的映射。此时根据映射过来的查询结果有两种途径:第一种可以选择添加选择的存储过程的函数到实体模型中。这样的话,查询的结果将会是xxx_result类型。List results = db.GetTestsString("2").ToList(); foreach (var result in results ) { Console.WriteLine(result .Id);}其中,GetTestsString_Result为EF自己生成的映射model,GetTestsString为存储过程名。第二种不选择添加 阅读全文
posted @ 2014-01-16 14:41 瓜王 阅读(570) 评论(0) 推荐(0) 编辑
摘要: 本文资料来源:http://www.codeproject.com/Articles/246861/LINQ-to-Entities-Basic-Concepts-and-Features)LINQ to Entities needs an Object Context object. The ObjectContext object is the bridge between LINQ and the database (we will explain more about ObjectContext later). LINQ to Objects don't need any in 阅读全文
posted @ 2014-01-16 14:23 瓜王 阅读(2942) 评论(0) 推荐(2) 编辑
摘要: 1、依据MSDN的官方描述:In previous versions of EF the code was split between core libraries (primarily System.Data.Entity.dll) shipped as part of the .NET Framework and out-of-band (OOB) libraries (primarily EntityFramework.dll) shipped in a NuGet package. EF6 takes the code from the core libraries and incor 阅读全文
posted @ 2014-01-15 13:26 瓜王 阅读(4784) 评论(0) 推荐(0) 编辑
摘要: DataSet:内存中的数据库,ADO.NET的核心对象之一。用于填充datareader,可以包含若干张DataTable。DataTable:内存中的一张表。可以自由添加row和column。DbSet:EF 5.0时每一个上下文对象都持有若干个DbSet泛型对象,该DbSet对应映射过来的表。HashSet:.net 3.5新增加的类型。使用了哈希算法,因此速度快。不像Dictionary和HashTable,没有键值对一说,其键就是值;也不像List,由于其本质是一个集合,因此集合中的数据是无序的。 阅读全文
posted @ 2014-01-14 17:27 瓜王 阅读(222) 评论(0) 推荐(0) 编辑
摘要: 操作成功 $('#msgBoxDIV').show(); setTimeout("$('#msgBoxDIV').hide()", 5000); 阅读全文
posted @ 2014-01-13 13:30 瓜王 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 18 下一页