Link to home
Start Free TrialLog in
Avatar of thefunnydad
thefunnydad

asked on

view thrown exception

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
Avatar of iboutchkine
iboutchkine

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
ASKER CERTIFIED SOLUTION
Avatar of gregoryyoung
gregoryyoung
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of thefunnydad

ASKER

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