Solved

view thrown exception

Posted on 2004-04-06
3
334 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
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 250 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Windows Management Instrument 6 59
asp.net mvc5 3 37
Wpf develop 5 32
Spacing between controls 4 16
IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now