zoukankan      html  css  js  c++  java
  • Column 'column' does not belong to table Table



    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    Column 'C' does not belong to table Table.
    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.ArgumentException: Column 'gameIsNow' does not belong to table Table.


    FROM:http://www.cnblogs.com/Sniper/archive/2006/03/06/343986.html

    最近项目上遇到一个很奇怪的问题,查询经常性的出错,这种出错是间歇性的。比如在代码中写select column1 from talbe1。执行完毕后Fill一个DataSet,再访问DataSet中的TableRow以及Column。通常会有一些莫名其妙的错误,例如
        Can not find Table 0.
        Column "column1" dose not belong to Table table.

       
    在大多数情况下,没有任何问题,但是程序运行一会儿(不定期),就会出现这个问题。过一会儿可能也好了,但是几十分钟或几个小时后又出现了。
       
    经过种种分析、排除,查找原因,最后把问题确定在connection.Close()的上。

    SqlConnection.Close Method

    http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemdatasqlclientsqlconnectionclassclosetopic.asp

    CAUTION   Do not call Close or Dispose on a Connection, a DataReader, or any other managed object in the Finalize method of your class. In a finalizer, you should only releaseunmanaged resources that your class owns directly. If your class does not own any unmanaged resources, do not include a Finalize method in your class definition. For more information, see Programming for Garbage Collection.


    根据这个文章,我们注释了log(日志记录)处的Finalize中的connection的close方法。问题得以解决,但是其原理百思不得其解。


  • 相关阅读:
    Qt QString转char[]数组
    Qt 如何使窗体初始最大化
    Qt 子窗口监听主窗口信号
    SQL SERVER 日志已满的处理方法 (转)
    C#中的sleep()和wait()
    C#中的sleep()和wait()
    C# 生成1100的随机数
    C# 生成1100的随机数
    gridcontrol 添加行号
    gridcontrol 添加行号
  • 原文地址:https://www.cnblogs.com/netwom/p/951042.html
Copyright © 2011-2022 走看看