Click here to Skip to main content
15,896,502 members
Home / Discussions / Database
   

Database

 
GeneralRe: Updating a datasource through a DataGrid Pin
hamidreza_buddy12-Jul-06 7:37
hamidreza_buddy12-Jul-06 7:37 
GeneralRe: Updating a datasource through a DataGrid Pin
leckey12-Jul-06 7:47
leckey12-Jul-06 7:47 
GeneralRe: Updating a datasource through a DataGrid Pin
hamidreza_buddy12-Jul-06 8:00
hamidreza_buddy12-Jul-06 8:00 
GeneralRe: Updating a datasource through a DataGrid Pin
leckey12-Jul-06 8:15
leckey12-Jul-06 8:15 
QuestionSetting up output parameters in stored proc: Part 2 Pin
leckey12-Jul-06 5:21
leckey12-Jul-06 5:21 
AnswerRe: Setting up output parameters in stored proc: Part 2 Pin
Mike Dimmick12-Jul-06 6:53
Mike Dimmick12-Jul-06 6:53 
GeneralRe: Setting up output parameters in stored proc: Part 2 [modified] Pin
leckey12-Jul-06 7:02
leckey12-Jul-06 7:02 
QuestionThrowing an exception based on sp's returned value Pin
Brendan Vogt12-Jul-06 3:18
Brendan Vogt12-Jul-06 3:18 
Hi,

This is how I code:

.aspx page --> BLL class --> DAL class --> BLL class --> .aspx page

In my stored procedure I usually do a test to see if a record has been inserted or updated. To test for an inserted record success, my code is:

-- Check for insert error
IF (@@ERROR <> 0)
BEGIN
SET @ErrorCode = -1; -- SQL Server error
GOTO CleanUp;
END

-- Commit transaction
IF (@TranStarted = 1)
BEGIN
SET @TranStarted = 0;
COMMIT TRANSACTION;
END

RETURN 0;


So if there happens to be an error it will return a -1. Now in my returned parameter, how do I throw this exception based on -1??? Is this the correct way to do it, or is there a better way of doing this? And where should I throw this exception, in my .aspx page, the BLL class, or the DAL class?

Please advise.

Regards
ma se
AnswerRe: Throwing an exception based on sp's returned value Pin
kumarprabhakar7412-Jul-06 18:33
kumarprabhakar7412-Jul-06 18:33 
QuestionRe: Throwing an exception based on sp's returned value Pin
Brendan Vogt12-Jul-06 21:34
Brendan Vogt12-Jul-06 21:34 
QuestionHow to create Database file programmatically? Pin
MityaB12-Jul-06 1:42
MityaB12-Jul-06 1:42 
AnswerRe: How to create Database file programmatically? Pin
Reza Raad12-Jul-06 2:16
Reza Raad12-Jul-06 2:16 
GeneralRe: How to create Database file programmatically? Pin
MityaB12-Jul-06 2:40
MityaB12-Jul-06 2:40 
AnswerRe: How to create Database file programmatically? Pin
Eric Dahlvang12-Jul-06 3:12
Eric Dahlvang12-Jul-06 3:12 
QuestionIterating trough database tables (SQL) Pin
johan313112-Jul-06 0:59
johan313112-Jul-06 0:59 
AnswerRe: Iterating trough database tables (SQL) Pin
kumarprabhakar7412-Jul-06 2:00
kumarprabhakar7412-Jul-06 2:00 
AnswerRe: Iterating trough database tables (SQL) Pin
Steve S12-Jul-06 3:03
Steve S12-Jul-06 3:03 
AnswerRe: Iterating trough database tables (SQL) Pin
Scott Serl12-Jul-06 6:29
Scott Serl12-Jul-06 6:29 
GeneralRe: Iterating trough database tables (SQL) Pin
johan313113-Jul-06 0:35
johan313113-Jul-06 0:35 
QuestionINSERT INTO and SELECT statement... pls help urgently.. Pin
For_IT12-Jul-06 0:19
For_IT12-Jul-06 0:19 
AnswerRe: INSERT INTO and SELECT statement... pls help urgently.. Pin
VK-Cadec12-Jul-06 9:53
VK-Cadec12-Jul-06 9:53 
QuestionData Access Application Block Pin
Brendan Vogt11-Jul-06 21:22
Brendan Vogt11-Jul-06 21:22 
AnswerRe: Data Access Application Block Pin
kumarprabhakar7412-Jul-06 0:25
kumarprabhakar7412-Jul-06 0:25 
QuestionThe using block Pin
Brendan Vogt11-Jul-06 21:12
Brendan Vogt11-Jul-06 21:12 
AnswerRe: The using block Pin
ekhorutomwen11-Jul-06 22:49
ekhorutomwen11-Jul-06 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.