LINQ链接数据库出错(There is already an open DataReader associated with this Command which must be closed first )

摘要: LINQ: There is already an open DataReader associated with this Command which must be closed first 在Linq to SQL和Entity Framework,使用Linq查询数据的时候会出现错误:There is already an open DataReader associated with this Command which must be closed first 。解决方案:在数据库连接串上添加MultipleActiveResultSets=true。 阅读全文
posted @ 2011-12-31 15:43 kenny jiang 阅读(276) 评论(0) 推荐(0) 编辑

图片提交表单方法

摘要: 把图片作为按钮的背景来提交 阅读全文
posted @ 2011-12-31 08:54 kenny jiang 阅读(288) 评论(0) 推荐(0) 编辑

Log4net实例

摘要: 参考资料:http://sunxitao88.blog.163.com/blog/static/68314439200842882112105/这里主要介绍web项目中的用法1.修改AssemblyInfo.cs文件(Properties文件夹下面)加入以下代码[assembly: log4net.Config.DOMConfigurator(ConfigFile = "web.config", Watch = true)]2.新建log.txt文件(放在根目录下面)3.修改web.config文件,添加以下代码 4.运行代码usin... 阅读全文
posted @ 2011-12-26 09:09 kenny jiang 阅读(312) 评论(0) 推荐(0) 编辑

Nibatis实例(2)

摘要: 1.配置文件Employee.xml delete from Employee WHERE ID = #Id# insert into Employee (EMPLOYEE_NUMBER, FIRST_NAME,LAST_NAME,TITLE) values (?,?,?,?) update Employee set EMPLOYEE_NUMBER = #EmployeeNumber#,FIRST_NAME = #FirstName#, LAST_NAME = #LastName#,TITLE = #Title# w... 阅读全文
posted @ 2011-12-25 16:21 kenny jiang 阅读(328) 评论(0) 推荐(0) 编辑

Nibatis实例(1)

摘要: 参考资料 http://www.cnblogs.com/anderslly/archive/2007/09/07/ibatisinactionpreface.html1.实体类using System;using System.Collections.Generic;using System.Linq;using System.Web;namespace NIbatis.Entity{ public class Employee { #region private fields private int id; private int employeeNumber; private string 阅读全文
posted @ 2011-12-24 22:05 kenny jiang 阅读(349) 评论(0) 推荐(0) 编辑

Linq入门实例

摘要: 1.数据定义using System;using System.Collections.Generic;using System.Web;using System.Linq;using System.Data.Linq;using System.Data.Linq.Mapping;namespace QuickStart{ [Table] public class Cat { private int catId; private string name; private char sex; private float weight; public Cat() { } [Column(IsDb. 阅读全文
posted @ 2011-12-24 16:02 kenny jiang 阅读(246) 评论(0) 推荐(0) 编辑

Entity Framework实例

摘要: 1、数据定义Book表using System;using System.Data.Objects;using System.Data.Objects.DataClasses;using System.Data.EntityClient;using System.ComponentModel;using System.Data.Entity;using System.ComponentModel.DataAnnotations;namespace EFTest.Models.Part2{ [Table("Book")] public class Book { [Key] p 阅读全文
posted @ 2011-12-24 15:48 kenny jiang 阅读(737) 评论(0) 推荐(0) 编辑