locked
Column 'xxx' not found in table RRS feed

  • Question

  • Hi Experts

    I have strange problem. I have a web application developed in vb.net. from this web application, I am calling a method GetData(querystring as string) from another class. In this method I do the following

    Define NEW datatable

    Open a new connection with USING

    Open a command with USING

    set commandtimeout=300

    Open new adapter with USING

    Fill the dataTable

    Close adapter using

    Close command using

    Close Connection using

    return datatable

     

    My issue is, some times, the returned datatable contains unexpected columns. ie) I expect two columns colA and colB in the table. But the result contains some other columns like colX,ColY, colZ etc.

    Infact, column X,Y,Z... is actually returned by this function from a previous call by the same page.

    I got this error in production server and not able to reproduce it in development. This issue is not for all calls. But it happens every now and then

    My Question is

    1. Is there any possibility of holding the previous result in the datatable and return it back when there is some issue in the current execution

    2. Is there any possibility of sending wrong result from SQL server when there is multiple requests ?

    3. setting commandTimeout=300 have any side effects ?

    I am using dotnet framework 3.0 and SQLServer2008 R2

    An average of 6000 to 7000 users use my site every day

     

    Thanks in advance

    • Moved by Mike Feng Wednesday, December 14, 2011 6:24 AM Asp.net (From:Visual Basic General)
    Monday, December 12, 2011 8:17 AM

Answers

  • I've given you already a longer reply in the C# forum. In addition to that.

    1. If you have not created the datatable shared (very stupid because you then get the results from another user) then on that no.

    2. No as long as you do them everytime new

    3. See message 1, normally your ASP.Application (which is not a client but a multiuser application which uses the clients webbrowser as client) has no state so it holds nothing.

    (Where do you keep the data of your datatable?)


    Success
    Cor
    Monday, December 12, 2011 8:22 AM