SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Data Corruption Issues
 data returned, but not from the correct table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

maican
Starting Member

Romania
6 Posts

Posted - 06/10/2009 :  08:48:35  Show Profile  Reply with Quote
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+property+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:
- http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/a9010d27-49ca-4cce-93a5-f3c4d62e4010
- http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/6191a59b-40cb-49f2-9f59-e9ee1bf2c683/
- http://stackoverflow.com/questions/843496/please-help-with-system-data-datarowview-does-not-contain-a-property-with-the-n
- http://stackoverflow.com/questions/959250/getting-unexpected-results-from-sql-query-in-my-asp-net-application
- http://forums.asp.net/t/1432140.aspx
- http://forums.asp.net/t/1426029.aspx
- http://forums.asp.net/t/1420133.aspx

Please HELP !!!!!

Catalin

SQLRatankalwa
Starting Member

India
42 Posts

Posted - 06/16/2009 :  09:25:30  Show Profile  Reply with Quote
Hi

It looks like you are converting Bigint instead of getting an Integer Value.

That is the reason why SQL Server is not able to convert the value.

You have to be careful while convertig the values to Bigint.

Ratan Kalwa
SQL Server Professionals User Group

http://www.revalsys.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000