Code From Fill Method Returns Different Results

dorkboy

Member
Joined
May 8, 2008
Messages
6
Programming Experience
10+
Hi All,

Newbie here. VB.Net 2008 & SQL Server 2005.

When I Execute the code in my Fill Method, I get different results than when I copy and paste the SQL code directly into a SQL Server window and execute it directly from SQL Server.

The column that is different is city.

The first row returned from the Fill Method will show the city as "Boston".

The first row returned when the query executes directly in SQL Server shows the city as "boston".

Any thoughts?

Thanks in advance!
 
Are you using DISTINCT or GROUP BY?

If SQLS is in case insensitive mode then the hashtable is built with the first value it finds, and then all other "equivalent" values are suppressed..

i.e. SQLS is merely accessing rows in a different order for your app vs the query manager. If you have a problem with this, write your SQL better; Convert the text to ProperCase before you group or before you return the rows
 
Thanks cjard.

There are no DISTINCT or GROUP BYs.

It is a straight select of 8 cols and ALL rows. I know it is NOT a case of returning Rows in a different order because I am comparing the City col by Primary Key.

SQL Server is in Case INSensitive mode - but it will return both 'boston' and 'Boston' when the query is run from a window on the SQL Server.
 
How strange.. Can you post the SQL, a set of INSERT statments and a CREATE TABLE and I will attempt to replicate here
 
Back
Top