LinqToSQL and the exception “ ExecuteReader requires an open and available Connection.”
问题 I have a collection called dbUsers of type IQueryable These are pulled from a linqtosql database context i.e. IQueryable<Data.LinqToSQL.User> dbUsers = DBContext.Users Calling ToList on this object: IList<Data.LinqToSQL.User> users = dbUsers.ToList(); Results in an exception: ExecuteReader requires an open and available Connection. The connection's current state is connecting. What am I doing wrong here? Cheers 回答1: see if this works for you: IList<Data.LinqToSQL.User> users = (from u in