View Complete Post
would any body please help me to catch the exception if the column doesnot exist as my table columns are not static.
sometimes its throwing me indexoutofrange exception as the column doesnot exist
thanks for the help guys
If multiple threads concurrently execute code that writes to or modifies a resource, then obviously the resource must be protected with a thread synchronization lock to ensure that the resource doesn't get corrupted.
MSDN Magazine June 2006
Here at MSDN Magazine, we get a lot of mail from readers. As you can imagine, much of it involves fulsome praise for our content, our eye-catching covers, or the handsome photo that now graces this page.
MSDN Magazine June 2005
MSDN Magazine August 2002
I've read up on this error from other posts and on other sites, but haven't found a solid resolution to the issue yet. My setup is as follows:
I have a RepositoryBase class that fields certain db calls that all repositories need to perform. In one such call, "GetSecurityGroup", it works most of the time, but will seemingly at random throw an exception with the error "Invalid attempt to call Read when reader is closed." All other Repository classes inherit from this one, and they all use the same DataContext object, which I understand isn't thread safe. Since there could be multiple calls to the DataContext object on the same page, perhaps one is using the DataContext when the next tries to do so. I'm not sure. What can I do to ensure this doesn't happen?