Crystal Reports : How to close database connection? Plz Hlp!
Hi !
I am using CrystalReportViewer to display the report using VB.NET inbuilt crystal report. The problem is every time a report is displaying, it is opening its own connection. How to close this connection once the user is through with the report.
Here is the Code:
=========================================================
Public Sub ShowReport(ByVal ReportFileName As String)
Try
Me._ReportName = ReportFileName
path = Application.StartupPath
oRpt.Load(path & ReportFileName) ' oRpt is report document
CrystalReportViewer1.ReportSource = oRpt
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
=========================================================
Thanks,
:)
Re: Crystal Reports : How to close database connection? Plz Hlp!
I do not know what method you are using, Just Read CR In VB.NET at My signature
Re: Crystal Reports : How to close database connection? Plz Hlp!
hi,
I have changed my original post and provided the code also. please see and reply.
Thanks,
Re: Crystal Reports : How to close database connection? Plz Hlp!
Put This Line at the above your code. :wave:
VB Code:
Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
Re: Crystal Reports : How to close database connection? Plz Hlp!
but i want to close the connection. After user has seen the report. How do i close the database connection.
Re: Crystal Reports : How to close database connection? Plz Hlp!
Can you tell me in your code where you are opening the connection, :confused: