'Cannot find column' errors RRS feed

  • Question

  • User-26825252 posted


    I have a project that has been in production for a couple years now. It's a v1.1 ASP.NET web farm hitting a SQL database. The last couple weeks, the website has been erroring out on  various pages for about 1-2 hours at a time twice a week. While the error messages are occurring, I cannot reproduce the errors myself.

    Here are some of the error messages I recieve:

    • Cannot find column [ColumnName]
    • [ColumnName] is neither a DataColumn nor a DataRelation for table RESULT.
    • [ColumnName] (This is a wierd one. The error message returned is just a column name)
    • No record found
    • Column '[ColumnName]' does not belong to table RESULT.

    I come to a dead end when I follow the Stack Trace to find a programmatic error.  I'm able to hit the same page with all the same form fields at the error occured on and I cannot reproduce.

    The only consistentcy in these errors is that they come all at once and they are database related.

     Anyone have an issue like this before?


    Thursday, October 11, 2007 4:02 PM

All replies

  • User1187105292 posted

    Are you saying you can't replicate the problem "later" or on the same webserver at the same time as other users are having the problem?

    Thursday, October 11, 2007 4:55 PM
  • User-26825252 posted

     I cannot replicate the problem at either time.

    I have the error messages emailed to me as they occur with information about the error and a link with URL parameters to the page. During the last incident, I was hitting pages where the error just occured moments before. 

    Any help is greatly appreciated... even if it's another question.


    Thursday, October 11, 2007 5:02 PM
  • User1181541869 posted

    You must use column name from the ASP.net, not from Database.

    For example, in my database, the column is [Closed Num]. But asp.net create the name [Closed_Num] for me. When you use filter expression, use [Close_Num] no problem. If you use the column name in the database, you will get the similar error!

    Hope it is helpful.


    Thursday, October 25, 2007 1:19 PM
  • User1643408281 posted

     How to fine the column name created by asp .net?

    Wednesday, November 26, 2008 4:32 PM
  • User1643408281 posted

     I am getting the error when I am trying to sort by clicking on the header text i.e. the column name on a gridview. The error says

    Server Error in '/' Application.

    'Cannot find column [column name]'

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IndexOutOfRangeException: Cannot find column Used with Segmentation.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [IndexOutOfRangeException: Cannot find column Used with Segmentation.]
    System.Data.DataTable.ParseSortString(String sortString) +4822286
    System.Data.DataView.CheckSort(String sort) +32
    System.Data.DataView.set_Sort(String value) +128
    System.Web.UI.WebControls.FilteredDataSetHelper.CreateFilteredDataView(DataTable table, String sortExpression, String filterExpression, IDictionary filterParameters) +94
    System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1610
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +19
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
    System.Web.UI.WebControls.GridView.DataBind() +4
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +22
    System.Web.UI.WebControls.GridView.OnPreRender(EventArgs e) +17
    System.Web.UI.Control.PreRenderRecursiveInternal() +80
    System.Web.UI.Control.PreRenderRecursiveInternal() +171
    System.Web.UI.Control.PreRenderRecursiveInternal() +171
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 


    If someone can help me with this, I'll be really thankful, I won't be fired from my job !!! 

    Wednesday, November 26, 2008 4:37 PM
  • User1281381861 posted


    Ur r querying A query against the database

    Now In u r query that u r requesting contains   [column name] 

    suppose ur query is


    Select [TestCol1],[TestCol2],[column name] ........................................


    Now Debug that Query by putting breakpoint on the line which is causing the error .

     Copy that Query 

    And run in sql server management studio Query anlyzer

    did it run succesfully on that?

    I am sure ,not it will give same error on message pane window.

    That means there is no column name  [column name] in that table from which u want to use that column.

    So Please Check That.








    Thursday, November 27, 2008 12:59 AM
  • User1030813329 posted


    Did you ever find a solution to this. We are experiencing the same problem. Same error messages from assemblies that has been working for the last 3 years, and also a couple of times a week for one or two hours, untill we restart our sql server instance.

    We have recently moved our code from sql server 2005, windows 2003 to windows 2008 web edition and sql server 2008, and started having these problems, so if you can give any insigt into this, please share.


    Wednesday, February 4, 2009 4:21 PM
  • User-10248131 posted

    I encountered the same problem and resolved it:

    The cause is when I post back the new data I got is empty due to a parameter error, once that's fixed, everything is working as expected.


    Monday, December 12, 2011 3:19 PM