SqueezeOJ
asked on
How to fix "Error while unloading appdomain." error in VB.net?
Hello,
Using VB.net in VS2010.
I have a Main form and then a Reports form. This Reports form has a ReportViewer, called rptExpenses. When I load the Reports form, the following code runs:
What am I doing wrong?
And how can I fix it?
Thanks!
Using VB.net in VS2010.
I have a Main form and then a Reports form. This Reports form has a ReportViewer, called rptExpenses. When I load the Reports form, the following code runs:
Private Sub frmReports_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SQLText As String = "SELECT * FROM expenses"
Dim SQLData As DataTable = DBGetTable(SQLText)
Me.rptExpenses.LocalReport.DataSources.Clear()
Dim rprtDTSource As Microsoft.Reporting.WinForms.ReportDataSource = New Microsoft.Reporting.WinForms.ReportDataSource(SQLData.TableName, SQLData)
Me.rptExpenses.LocalReport.DataSources.Add(rprtDTSource)
Me.rptExpenses.LocalReport.ReportPath = "C:\Users\Jason\Documents\Visual Studio 2010\Projects\Remote-Expense\Remote-Expense\Report1.rdlc"
Me.rptExpenses.RefreshReport()
End Sub
Here's the problem: Everything works fine, however, when I exit the entire application (not the Reports form), I get the following error:
Error while unloading appdomain. (Exception from HRESULT: 0x80131015)
Screenshot:Commenting out this one line removes the error:
Me.rptExpenses.LocalReport.ReportPath = "C:\Users\Jason\Documents\Visual Studio 2010\Projects\Remote-Expense\Remote-Expense\Report1.rdlc"
[u]Questions:[/u]What am I doing wrong?
And how can I fix it?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks @Netminder
Hola amigo buenas tardes, te saludo desde Colombia, aplicando la solución que tu aportas al problema del compañero, a mi me sale un error con el código.
Me.rptExpenses.LocalReport .ReleaseSa ndboxAppDo main() = rptExpenses me aparece como error y no me deja soluciona la falla. es la misma expuesta por el compañero primero. Agradezco su colaboración.
Me.rptExpenses.LocalReport
ASKER