none
connection problems RRS feed

  • Question

  • I am running an ASP.NET application. Quite often I am getting random error like the below:

    # Column col does not belong to table Table


    # Cannot find table 0


    # Cannot find column col

    Environment details:

    Windows 2003 Enterprise Edition
    SQL Server 2005 Enterprise Edition (Service Pack 2.0 installed)
    .NET Framework 2.0
    Driver used: SqlClient

    Please, I'm desperate with this one and don't know what to do,
    somebody help me out please

    Thanks in advance!
    Tuesday, October 7, 2008 8:39 AM

All replies

  • Are you building some sort of dynamic DataTable? The best way to figure out what is going on is to put some sort of tracing into your code to see where it fails and what is the application state at that moment of time. For example, you could log name of the function that fails, input parameter values, executed SQL statement etc.

     

    Tuesday, October 7, 2008 8:27 PM
    Moderator
  •  VMazur wrote:
    Are you building some sort of dynamic DataTable? The best way to figure out what is going on is to put some sort of tracing into your code to see where it fails and what is the application state at that moment of time. For example, you could log name of the function that fails, input parameter values, executed SQL statement etc.

     



    No, I'm not and I track code as I get emailed everytime an error occurs with complete stack trace, method that caused the error, etc.

    The problem is that it happens randomly and the error raised by .net does not give any information at all.

    Anyway, I changed the driver from sqlclient to oledb,
    things look quite better,
    there were some errors,

    like

    System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Data.OleDb.OleDbException: Timeout expired at System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr) at System.Data.OleDb.OleDbDataReader.NextResult() at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at...

    and

    System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at ...

    but a lot less,
    looking forward to correct the rest of them too...


    Wednesday, October 8, 2008 8:09 AM
  • Timeout expired error could be related to the fact that your SQL statement runs longer than 30 seconds, which is default timeout. I would suggest you to profile server to see what is going on with your query. It could be missing index or query selects too many records and you would need to refactor your code, or, simply, there is not enough hardware to handle all the staff running on that server.

     

    About Objecty reference not set error: do you use shared/static variables that reference DataSet your are populating?

     

    Wednesday, October 8, 2008 5:51 PM
    Moderator
  •  VMazur wrote:

    Timeout expired error could be related to the fact that your SQL statement runs longer than 30 seconds, which is default timeout. I would suggest you to profile server to see what is going on with your query. It could be missing index or query selects too many records and you would need to refactor your code, or, simply, there is not enough hardware to handle all the staff running on that server.

     

    Thank you very much for your answer and interest mr VMazur!

     

    Timeout expired errors stopped today possibly because I added command timeout equal to 5 mins (5*60)!

    Basically there is a part on the page (at the top),

    which I have ajax code responsible to change some middle part of the page,

    without posting it back,

    like erasing some elements and writing new ones and this seems to be very slow in responding and I can't figure out why

    (I think that this doesn't have to do with the query involved)

     

     VMazur wrote:

    About Object reference not set error: do you use shared/static variables that reference DataSet your are populating?

     

    I think I have fixed that error too,

    after tinkering with my code,

    but lately I get another one:

     

    Error Message: Padding is invalid and cannot be removed.
    Exception:
    System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
    at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
    at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)

    Can you or anybody else give me feedback on the later one or perhaps I should start a different thread?
    Wednesday, October 8, 2008 10:08 PM
  • You could increase timeout, but I would suggest to run SQL Profiler tools from SQL Server to see how query performs. If query runs for very long period of time, your clients might get upset and you would need to do it anyway. Generally if query does not fit into default 30 seconds timeout, you should pay attention to it.

     

    I believe second error related to incorrect byte array allocation when you try to use use encryption. Check next post that descibes this situation

     

    http://forums.asp.net/t/1064000.aspx

     

    If it does not help, you would need to open separate post in appropritae forum. But if you post here, I could try to split the post and move security-related part to appropriate forum

    Thursday, October 9, 2008 11:59 AM
    Moderator