views:

66

answers:

2

I have a data access layer which returns DataSets/DataTables by executing Stored Procedure. Everything was working fine from many months. But suddenly we have started getting the following error.

System.ArgumentException; Column < ColumnName > does not belong to table < TableName >

I wrote come extra logging code to troubleshoot this issue. I was shocked to see that the SP sometimes returns Unexpected result set. The Stored Procedure sometimes returns result that are requested by a Windows Services using some other Stored Procedure.

I monitored the Sql Server traffic using a Profiler. When this error occured Sql Profiler didn't show any execution for the SP that I actually executed. Its difficult to reproduce this bug it happens randomly.

We have only faced this problem in our testing environment. Our testing environment is running Windows 2003 Server & Sql Server 2005 Express Edition.

In past we have run several rigorous load test on our application using both Sql Server 2005 Express and Standard Edition but we have never faced this issues.

Has anybody faced such problem before?

Update

I dumped the result that I got after executing the stored procedure to the log file. I found out that the result returned are sometimes empty and sometimes result of sp's that are executed by different windows services.

This problem doesn't occur in any other environment. So I have stopped looking into this problem.

A: 

The error

System.ArgumentException; Column < ColumnName > does not belong to table < TableName >

states that, in that table no such column exists.

Check whether the column name is returning properly from your SP.

priyanka.sarkar