J
John
In a couple of stored procedures (SQL Server 2000) im doing:
raiserror('aaa',16,1)
return 1
My understanding was that this should throw an exception in my C# code. But
sometimes it doesn't (I have to manually check the return value parameter).
Can anyone explain why?
Is there a difference in behaviour between SqlCommand.ExecuteNonQuery and
ExecuteReader (or SqlDataAdapter.Fill) in this regard? The situation where
I've noticed no exception is being thrown is when I'm calling
adapter.Fill(), and the sproc has already returned a resultset (but later on
in the sproc code it detects an error).
Maybe the presence of a resultset prevents an exception being thrown?
Thanks,
John
raiserror('aaa',16,1)
return 1
My understanding was that this should throw an exception in my C# code. But
sometimes it doesn't (I have to manually check the return value parameter).
Can anyone explain why?
Is there a difference in behaviour between SqlCommand.ExecuteNonQuery and
ExecuteReader (or SqlDataAdapter.Fill) in this regard? The situation where
I've noticed no exception is being thrown is when I'm calling
adapter.Fill(), and the sproc has already returned a resultset (but later on
in the sproc code it detects an error).
Maybe the presence of a resultset prevents an exception being thrown?
Thanks,
John