我遇到以下错误消息,我正在使用petaPOCO。为什么我在此错误消息,什么我做错了有这个消息:找不到异常消息
{"There is already an open DataReader associated with this Command which must be closed first."}
This is what I have been able to copy for the exception message.
System.InvalidOperationException了抓 消息=已经有一个与此相关联的打开的DataReader必须先关闭的命令。 源= System.Data 堆栈跟踪: 在System.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand的命令) 在System.Data.SqlClient.SqlConnection.ValidateConnectionForExecute(字符串方法,SqlCommand的命令) 在System.Data.SqlClient的。 SqlCommand.ValidateCommand(String method,Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String method,DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior,RunBehavior runBehavior,Boolean returnStream,String方法) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at PetaPoco.Databas e.Insert(字符串表名,字符串primaryKeyName,布尔自动增量,对象POCO)在C:\开发\代码\ API \模型\ PetaPoco.cs:线1243 的InnerException:
显示正在使用DataReader的代码 – Andy 2012-03-01 07:01:33
您使用的是db.Query方法吗? – patmortech 2012-03-01 11:12:20
请添加一些数据访问逻辑代码。 – 2012-03-06 08:36:31