Column '<ColumnName>' does not belong to table


  • This error occurs sporadically in a production appllication.  It is a Windows Forms application in VS 2008, not an ASP app.  When testing this problem the queries are usually the most simple ones (such as "SELECT TableID FROM Table WHERE..." then the error tells me that "Column 'TableID' does not belong to table")  The fields always exist, and the query runs repeatedly during the application use and succeeds 99% of the time, but occasionally this occurs. 

    Does anyone have any ideas?  Any help would be appreciated. 
    • Moved by Figo Fei Friday, February 19, 2010 3:58 AM (From:Visual Studio Team System - Testing)
    Thursday, February 18, 2010 12:30 PM

All replies

  • Moved to Winform forum for further response

    Thanks for understanding.

    Figo Fei
    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact 

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Friday, February 19, 2010 3:57 AM
  • Do you get this error while accessing the datatable at a later stage in your application?

    Are you trying to access the column in question by the name you gave it at the time of creating the datatable?

    Do you use a data adapter to fill the data table?

    If yes, then your data adapter is overwriting the column name that you set for the column in question, at the time of creating it.

    Hope this helps.



    Tuesday, March 15, 2011 2:06 PM