今天在做一个项目时发现一奇怪的问题,连续两次执行程序时发现错误,搞的我摸不到头
脑。
在这次开发中,总结前几次经验,重新构造了数据访问类。
程序报错所在位置一直是这个类文件,我又从新修改,编译多次还是有问题。
火了,从新检查所有的代码,发现问题。在有一处返回值时没有关闭SqlDataReader,难
道是这里的问题,关闭,问题解决.
在大项目时不考虑用SqlDataReader,直接用DataTable.