tag:blogger.com,1999:blog-125341290284114978.post2830686736596311260..comments2023-04-23T00:05:10.829-07:00Comments on Guy Ellis' Tech Blog: Invalid attempt to call MetaData when reader is closedGuy Ellishttp://www.blogger.com/profile/02574435376236977220noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-125341290284114978.post-88855530904822900672012-02-23T11:25:35.000-08:002012-02-23T11:25:35.000-08:00Hi,
I'm interested by your solution. Can you p...Hi,<br />I'm interested by your solution. Can you provide a example of this solution please ? When you say "use a using statement around the DataContext"... i'm not sure to understand...<br />Thanks !Chucknoreply@blogger.comtag:blogger.com,1999:blog-125341290284114978.post-43659331852801076942009-05-27T10:21:32.000-07:002009-05-27T10:21:32.000-07:00If I remember correctly it was because I had setup...If I remember correctly it was because I had setup the functions in the DB class as static functions and was not locking (synchronizing) each call.<br />The bad solution to the problem was to wrap each call inside the solution with a lock(lockObj) etc.<br />The good solution was to change the functions from static to instance methods and use a using statement around the DataContext. This is ultimately what I did.guy ellisnoreply@blogger.comtag:blogger.com,1999:blog-125341290284114978.post-11065011560983113092009-05-27T09:23:15.000-07:002009-05-27T09:23:15.000-07:00Did you ever solve it, and how? Seem to have the s...Did you ever solve it, and how? Seem to have the same problem.<br />// TobiasTobias Hartungnoreply@blogger.com