Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

view thrown exception

Posted on 2004-04-06
3
Medium Priority
?
343 Views
Last Modified: 2012-06-27
Well, difficult to me anyway. I'm stepping through someone elses code in a dotnet app. A DLL is called further downstream, where the below shown procedure is executed. There is an error being thrown, but I cannot seem view the error. The Connection is opened, but the Fill seems to fail. I cannot modify the DLL to view the exception and a console.writeline inserted prior to the throw won't work.

    Public Function Fill(ByVal DataSetAdapter As SqlClient.SqlDataAdapter, ByVal dataset As DataSet) As Integer
        Try
            OpenConnection()
            DataSetAdapter.SelectCommand.Connection = cn
            Fill = DataSetAdapter.Fill(dataset)
        Catch ex As Exception
            Throw New ISCException(ex)
        Finally
            CloseConnection()        
        End Try
0
Comment
Question by:thefunnydad
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 10766406
First of all your function Fill is an Integer datatype

the line
            Fill = DataSetAdapter.Fill(dataset)

will return dataset, which you are trying to assign to integer. I think that is causing the problem

I would've define function asd dataset and then
instead of
 Fill = DataSetAdapter.Fill(dataset)
 use
DataSetAdapter.Fill(dataset)
Return
0
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 750 total points
ID: 10779473
umm ...

Fill returns the # of rows ...
from MSDN
"Return Value
The number of rows successfully added to or refreshed in the DataSet. This does not include rows affected by statements that do not return rows.
"

from looking at the code I would guess that the ISCException is using the exception as its innerexception although it may not be . I would need to see the code for ISCexception to be sure.

If you have access to this code (which it sounds like you do ...) set a break point on the throw ... then in the command window type "? ex" when it hits ... it will dump the original exception.

I would also take a look at the exception class to see what he might be doing with the original exception for future use.

Greg
0
 

Author Comment

by:thefunnydad
ID: 10790983
Issue was a little more protracted; but you were closest Greg. ISCException was throwing the exception because there was an issue with the connection paramters being passed. I found this by accident however; I did not code the ISCException handler, but it would havemore beneficial to me if the Throw had returned the error to some place where I coud see it.


Thanks for the help(s)

Regards,

Scott
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question