T
TheNortonZ
This is probably a stupid question but its been so long since I've had to do
it with ADO, I can't decide which way to do this in ADO.Net.
I have basic stored procedures (SQL 2000/MSDE) that do inserts, updates and
deletes. I call these from an SQLDataAdapter Update/Insert/Delete -> Update
command.
So, I can put a try/catch around the adapter Update call, but should I just
be trying to catch a Sqlexception? How should I throw the error within the
stored proc? For example, I can do:
DELETE FROM tblMine WHERE myID = @iID
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN A
RETURN ?
END
Should I return a value? I suppose a basic sample might be all I need.
Thanks.
STom
it with ADO, I can't decide which way to do this in ADO.Net.
I have basic stored procedures (SQL 2000/MSDE) that do inserts, updates and
deletes. I call these from an SQLDataAdapter Update/Insert/Delete -> Update
command.
So, I can put a try/catch around the adapter Update call, but should I just
be trying to catch a Sqlexception? How should I throw the error within the
stored proc? For example, I can do:
DELETE FROM tblMine WHERE myID = @iID
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN A
RETURN ?
END
Should I return a value? I suppose a basic sample might be all I need.
Thanks.
STom