Solved

view thrown exception

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VS 2017 18 188
Visual Studio npm 1 39
Need to find a web event on the IIS server 4 52
SQL Server Serialization error 8 45
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

734 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