Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Catch SQL Server's RAISERROR message

Reply
Thread Tools

Catch SQL Server's RAISERROR message

 
 
=?Utf-8?B?RW56byBNYXJpbmVsbGk=?=
Guest
Posts: n/a
 
      05-12-2004
Hello everyone

I have a HUGE database, with very complex stored procedures that handle every possible error and the passed it to an ASP site with RAISERROR

Now I need to use that same database on an ASP.NET site, but all I can do is

Tr
Common.ExecuteNonQuery(QueryString, Common.Connection
Catch Ex As SqlExceptio
Result.Text = Ex.Messag
Finall
Common.Connection.Close(
End Tr

I really NEED to have the RAISERROR message... how can I do this

I tried some people's advice, by doing this

Dim myError As OdbcErro
For Each myError In Ex.Error
Result.Text = Result.Text & myError.Message() & "<br/>
Nex

But there I only get the elements

[Microsoft][ODBC SQL Server Driver][SQL Server]Violation of PRIMARY KEY constraint 'PK_User'. Cannot insert duplicate key in object 'User'
[Microsoft][ODBC SQL Server Driver][SQL Server]The statement has been terminated

I DON'T get my RAISERROR message... Even though if I execute this Stored Procedure on the Query Analyzer, and I get this

Server: Msg 2627, Level 14, State 1, Procedure InsertCompany, Line 7
Violation of PRIMARY KEY constraint 'PK_User'. Cannot insert duplicate key in object 'User'
The statement has been terminated
Server: Msg 50000, Level 16, State 1, Procedure InsertCompany, Line 8
The username 'emarinelli' has already been taken.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
catch doesn't catch a thrown exception Marteno Rodia Java 5 08-05-2009 03:30 AM
SQL Reference, SQL Queries, SQL help ecoolone ASP .Net 0 01-03-2008 10:58 AM
catch(...) doesn't catch everything Adam C++ 9 02-02-2006 05:02 PM
why catch (...) can not catch such exception John Black C++ 8 08-20-2004 02:34 PM
Catch SQL Server's RAISERROR message =?Utf-8?B?RW56byBNYXJpbmVsbGk=?= ASP .Net 6 05-12-2004 08:19 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57