November 13th, 2003, 07:07 PM
Join Date: Jul 2003
Location: Brisbane, Australia
Time spent in forums: < 1 sec
Reputation Power: 0
ADO.NET vs. Query Analyzer: Inconsistent Results
Can anybody explain the following behaviour?
In SQL Query Analyzer:
EXEC GetStatistics 0, 7, 2004
(1 row of data returned - the correct result)
// SqlConnection connection; // connects successfully
// SqlCommand command; // initialized with the query from above, the appropriate parameters, and the connection
DataSet ds = new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter( command );
int numRows = adapter.Fill( ds );
// numRows == 4
// four rows are returned, when there should only be one.
I've checked and rechecked all the parameters, the query text itself -- the lot -- and I can't work out what's going on.
Can anybody shed some light as to why this may be happenning?