473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

New properties of Exception descendant are not shown in snapshot viewer

Problem:
I created a custom exception that inherits from Exception and added a some
of new properties. All new properties filled in the constructors. When I
throwing this custom exception and go to the snapshot viewer the last shows
only properties of Exceptions, the new properties are not shown.
Question:
How to show new properties of Exception-descendants in the snapshot viewer
(such as, for example, SqlException shows Procedure, Line and etc.)?
Dec 4 '06 #1
4 1351
It should work!!!.

you are trying to use the viewer in catch() statement? is your catch
statement declared the exception object of Type MyCustomException?
//catch(MyCustomException ex)
//and not
catch(Exception ex)

Regards,
Stanislaw Tristan wrote:
Problem:
I created a custom exception that inherits from Exception and added a some
of new properties. All new properties filled in the constructors. When I
throwing this custom exception and go to the snapshot viewer the last shows
only properties of Exceptions, the new properties are not shown.
Question:
How to show new properties of Exception-descendants in the snapshot viewer
(such as, for example, SqlException shows Procedure, Line and etc.)?
Dec 5 '06 #2
Yes, of cource, MyCustomException

"singhhome" <si*******@gmail.com???????/???????? ? ???????? ?????????:
news:11*********************@73g2000cwn.googlegrou ps.com...
It should work!!!.

you are trying to use the viewer in catch() statement? is your catch
statement declared the exception object of Type MyCustomException?
//catch(MyCustomException ex)
//and not
catch(Exception ex)

Regards,
Stanislaw Tristan wrote:
>Problem:
I created a custom exception that inherits from Exception and added a
some
of new properties. All new properties filled in the constructors. When I
throwing this custom exception and go to the snapshot viewer the last
shows
only properties of Exceptions, the new properties are not shown.
Question:
How to show new properties of Exception-descendants in the snapshot
viewer
(such as, for example, SqlException shows Procedure, Line and etc.)?

Dec 7 '06 #3
I tried it on my system and it was showing new properties in the
visualizer!
can u send ur code of mycustomexception?

Regards,
Stanislaw Tristan wrote:
Yes, of cource, MyCustomException

" It should work!!!.

you are trying to use the viewer in catch() statement? is your catch
statement declared the exception object of Type MyCustomException?
//catch(MyCustomException ex)
//and not
catch(Exception ex)

Regards,
Stanislaw Tristan wrote:
Problem:
I created a custom exception that inherits from Exception and added a
some
of new properties. All new properties filled in the constructors. When I
throwing this custom exception and go to the snapshot viewer the last
shows
only properties of Exceptions, the new properties are not shown.
Question:
How to show new properties of Exception-descendants in the snapshot
viewer
(such as, for example, SqlException shows Procedure, Line and etc.)?
Dec 7 '06 #4
This a code of Exception:

Imports Zestad.Common.Validation

Namespace Exceptions

''' <summary>
''' Occurs if one or more business rules validation breaks
''' </summary>
<Serializable()_
Public Class ValidationException : Inherits Exception

Private varErrors As List(Of ValidationError)
''' <summary>
''' List of validation errors
''' </summary>
Public ReadOnly Property Errors() As List(Of ValidationError)
Get
Return varErrors
End Get
End Property

Private varTestProperty As string
''' <summary>
''' This is a test property for test catching and showing in the visualizer
''' </summary>
Public ReadOnly Property TestProperty() As string
Get
Return varTestProperty
End Get
End Property

''' <summary>
''' Constructor of this class
''' </summary>
Public Sub New(ByVal Message As String, Test as string, ByVal Errors As List(Of ValidationError))
MyBase.New(Message)
Me.varErrors = Errors
Me.varTestProperty=Test
End Sub

''' <summary>
''' Returns bulleted string with error descriptions
''' </summary>
Public Overloads Function ToString(Optional ByVal Bullet As String = "", Optional ByVal IncludeMessage As Boolean = False) As String
If Me.Errors.Count = 0 Then Return ""
Dim ErrorsArray(Me.Errors.Count) As String
For i As Integer = 0 To Me.Errors.Count - 1
ErrorsArray(i) = Bullet & Me.Errors(i).Cause
Next
If IncludeMessage = True Then
Return Me.Message & StrDup(1, Chr(13) & Chr(10)) & Join(ErrorsArray, Chr(13) & Chr(10))
Else
Return Join(ErrorsArray, Chr(13) & Chr(10))
End If
End Function
End Class

End Namespace

And this is a block catch:

try
....some_code...
throw new ValidationException ("test_message", "test_property_value", varErrors)
....
catch ex as ValidationException
throw ex ' visualizer shows only properties of parent class (Exception), but not ValidationException
end try

"singhhome" <si*******@gmail.comсообщил/сообщила в новостях следующее: news:11**********************@73g2000cwn.googlegro ups.com...
>I tried it on my system and it was showing new properties in the
visualizer!
can u send ur code of mycustomexception?

Regards,
Stanislaw Tristan wrote:
>Yes, of cource, MyCustomException

" It should work!!!.
>
you are trying to use the viewer in catch() statement? is your catch
statement declared the exception object of Type MyCustomException?
//catch(MyCustomException ex)
//and not
catch(Exception ex)

Regards,
Stanislaw Tristan wrote:
Problem:
I created a custom exception that inherits from Exception and added a
some
of new properties. All new properties filled in the constructors. When I
throwing this custom exception and go to the snapshot viewer the last
shows
only properties of Exceptions, the new properties are not shown.
Question:
How to show new properties of Exception-descendants in the snapshot
viewer
(such as, for example, SqlException shows Procedure, Line and etc.)?
Dec 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Louis Eastwood | last post by:
I am getting this error when trying to create a Snapshot report in Access 97 on Win98 machine: "Microsoft Access can't complete the Output operation. The Visual Basic code you entered contains a...
1
by: Rick Brown | last post by:
I'm trying to find a way to output a Access97 report to a file without losing any of the formatting. The Microsoft Snapshot Viewer does this perfectly but the person opening the file needs the...
0
by: Soly | last post by:
I would like to use automation to print a snapshot file from an snapshot viewer ActiveX control using the PrintSnapshot method. The argument for this method is True/False to show/hide the Print...
5
by: tom | last post by:
Hey All- I've exported a report to Access's "snapshot" format and want to put it on a website for users to view. However, when I click on the link to the snapshot file, I notice that my browser...
9
by: bluedolphin | last post by:
Hello All: I have been brought onboard to help on a project that had some performance problems last year. I have taken some steps to address the issues in question, but a huge question mark...
3
by: DavidB | last post by:
I have a Snapshot Control in a continuous form and I want the source for the control to be different for each instance of the continuous data (based on one of the fields in the recrod source for...
4
by: Salad | last post by:
Hi: I have the following line: DoCmd.SendObject acSendReport, "TestReport", _ "SnapshotFormat (*.snp)", _ "joeblow@nowhere.com", , , "Report Test", _ "Does it open correctly?", True I have...
3
by: Steven Thomas | last post by:
I am working on a ASP.NET application using VB.NET. I have a function that creates a snapshot file on a separate server and passes a path back to the webpage. Now I want to display the snapshot. ...
8
by: grant | last post by:
Hi I've copied Stephens code into my db, and can get it to work, but only on "plain Jane" reports with no images. Most of my reports has an unbound image obluect in them that I set to an...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.