100% Australian Windows Web Hosting
  • Knowledge Base

SQL Errors such as "column does not belong to table" occur randomly 

Was this helpful? (21) (4)

If an error such as "column "x" does not belong to table "y"" occurs randomly within an ASP.NET site care should be taken to ensure that a single SQLConnection object is not accessed from multiple threads.

There are a couple of scenarios where this might occur:

  1. SQLConnection declared within a shared class.
  2. SQLConnection stored in a session or application variable.
Ensuring that a new SQLConnection object is created for every page request when needed is the best way to prevent these errors from happening.