首页 > 代码库 > error 'there is already an open datareader associated with this command which must be closed first'

error 'there is already an open datareader associated with this command which must be closed first'

This can be easily solved by allowing MARS in your connection string. Add MultipleActiveResultSets=true to the provider part of your connection string (where Data Source, Initial Catalog, etc. are specified).

http://msdn.microsoft.com/en-us/library/h32h3abf(v=vs.100).aspx

error 'there is already an open datareader associated with this command which must be closed first'