Linq to SQL - Invalid attempt to call FieldCount when reader is closed

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-06-07T19:58:50Z Indexed on 2010/06/07 20:02 UTC
Read the original article Hit count: 686

Filed under:

Hey, Has anyone seen this error before when making a Linq to SQL call?

Invalid attempt to call FieldCount when reader is closed

Here's the code:

public static MM GetDeviceConfiguration(long ipAddress)
            {
                string sprocName = ConfigurationBL.ReadSproc("ReadDeviceConfiguration");
                return db.ExecuteQuery<MM>("exec {0} @IPAddressNumber = {1}", sprocName, ipAddress).FirstOrDefault();
            }

Thanks, Justin

© Stack Overflow or respective owner

Related posts about linq-to-sql