Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Unanswered: Data returned but not from the correct table

    Hi,

    I've encountered a very, very strange situation in my application. I say strange because the errors are **intermitent** and I cannot find out the cause why they occur.

    The error is shown to the end-user using a code where I pass a sqlcommand to the DB (Sql 2005) trying to get a bigint (column ID_Facultate) from a single table. The problem is that I've got a string (the name of a lecture) that has nothing to do with the that table.

    Also, when I get these errors, **all** my application is going crazy.

    In the SQL Profiler everything *seems* fine (the last executing rows seem to be the ones sent by my application)

    Here are some links to 3 captured screens during the errors and the code I've used. Please note the Watch1 with the **very wrong** string value where I expected some integer...

    http://www.unitbv.ro/cata/errors/2.jpg
    http://www.unitbv.ro/cata/errors/3.jpg
    http://www.unitbv.ro/cata/errors/1.jpg
    http://www.unitbv.ro/cata/errors/class.txt

    The same error also appears in code where I use SqlDataSource this time the error is similar to "System.Data.DataRowView'+does+not+contain+a+prope rty+with+the+name+'DenumireMaterie"... And this is true since the database seems to return fields from *other* tables and note from the queried one...

    Here are some other discussions from other forums, but nothing helped:
    - Help with intermitent errors
    - Strange DataRowView errors when generating large reports
    - Please help with 'System.Data.DataRowView' does not contain a property with the name... - Stack Overflow
    - Getting unexpected results from SQL query in my asp.net application - Stack Overflow
    - Please help with this intermitent error - ASP.NET Forums
    - How can I track this error? - ASP.NET Forums
    - Please help with 'System.Data.DataRowView' does not contain a property with the name... - ASP.NET Forums

    Please HELP !!!!!

    Catalin

  2. #2
    Join Date
    Mar 2009
    Posts
    349
    I have a suspicion. DO you have a SQL code example?

  3. #3
    Join Date
    Mar 2009
    Posts
    349
    I saw something like this once where 2 web clients in a .Net app would get the results that the other was running. It had something to do with session management I believe.

  4. #4
    Join Date
    Jun 2009
    Posts
    3
    Thank you for you interest. Here http://www.unitbv.ro/cata/errors/class.txt there is one example of sql used. I created this class to avoid the errors mentioned above but it doesn't work very well

    string query = "SELECT ID_Facultate FROM Facultate where PortalID = " + this.PortalId.ToString(); e.g. where PortalId = 8 .... and Facultate is a _table_

    in this case I would expect a single integer value but, in some cases, I get a string (as I said, the name of a lecture from _another_ table)

    As I've mentioned above, the errors are intermitent - maybe on high load? I do not know...

    Catalin

  5. #5
    Join Date
    Mar 2009
    Posts
    349
    and what data type is ID_Facultate? An INT in the data definition language right?

    If your data type is an int, and I am more of a SQL guy than a .Net guy, but this sounds a lot like some thing I saw on a project a couple of years ago. If your data type is integer, there is no way the database is returning a string and this has something to do with IIS/.Net and session management.

  6. #6
    Join Date
    Jun 2009
    Posts
    3
    Thank you for your answer... maybe related to the way IIS/.net handles sessions with the database... because my application does not use Session object

    catalin

  7. #7
    Join Date
    Mar 2009
    Posts
    349
    In your Profiler Trace, what do you see your application sending to the database? What does this query do in SQL Server Management Studio?

    This is more than likely something buggered out in your application code\ framework.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •