J
James Hokes
Hi All,
We're using the 1.1. Framework against SQL Server 2000, and are having a
strange issue where we don't get errors back from the stored procedure, i.e.
the exception never gets thrown.
We use SqlDataReader objects to stream stored procedure results back when we
have a smallrowsets.
Normally, our code looks like so:
'...set up connection and command...
rdr = cmd.ExecuteReader
While rdr.Read
'Process row...
Loop
'et cetera...
In this case, the exception fires normally.
However, one of our developers tried:
If rdr.HasRows Then
While rdr.Read
'Process row..
Loop
End If
This results in the total suppression of SQL Server errors that occurred in
the stored procedure.
Why does this occur?
Of what use is HasRows() if it doesn't throw the exceptions that are
apparently waiting in the SqlDataReader stream?
Are there any other "scenarios" we should be aware of which would suppress
the SQL Exceptions? This is scary.
Thanks,
James Hokes
We're using the 1.1. Framework against SQL Server 2000, and are having a
strange issue where we don't get errors back from the stored procedure, i.e.
the exception never gets thrown.
We use SqlDataReader objects to stream stored procedure results back when we
have a smallrowsets.
Normally, our code looks like so:
'...set up connection and command...
rdr = cmd.ExecuteReader
While rdr.Read
'Process row...
Loop
'et cetera...
In this case, the exception fires normally.
However, one of our developers tried:
If rdr.HasRows Then
While rdr.Read
'Process row..
Loop
End If
This results in the total suppression of SQL Server errors that occurred in
the stored procedure.
Why does this occur?
Of what use is HasRows() if it doesn't throw the exceptions that are
apparently waiting in the SqlDataReader stream?
Are there any other "scenarios" we should be aware of which would suppress
the SQL Exceptions? This is scary.
Thanks,
James Hokes