It has been pretty painful investigating this weird problem – “Column <ColumnName> does not belong to table Table” even though we have this column in the specified table. Sometime it is just throws error – “….table ‘Table’” when there is no such table ‘Table’ in database.
After thorough investigation many experiments, we found that the root cause of this problem is Corrupted Database Connection Pool.
First reason could be some code is not closing the connection properly, and the other reason could be restarting IIS Server several times without cleaning up the connection pool.
One of the important fact is that just stopping IIS Server will not clean the connection pool. When you restart the IIS Server it will use the pool that was created earlier.
Finally the Solution options are:
1. Use ‘iisreset’ command every time you stop the IIS server
2. Walk through your code and make sure you are closing connection properly.
3. Use ‘Connection Lifetime’ property of connection pool if required.
4. Try to use ClearAllPools/ClearPool in appropriate application event
To learn more on this here are some good links: