|
-
Dec 23rd, 2006, 06:38 AM
#1
Thread Starter
New Member
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,
Last edited by vishesh_marwah; Dec 23rd, 2006 at 06:59 AM.
-
Dec 23rd, 2006, 06:43 AM
#2
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
-
Dec 23rd, 2006, 07:00 AM
#3
Thread Starter
New Member
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,
-
Dec 23rd, 2006, 07:06 AM
#4
Re: Crystal Reports : How to close database connection? Plz Hlp!
Put This Line at the above your code.
VB Code:
Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument
-
Dec 23rd, 2006, 08:20 AM
#5
Thread Starter
New Member
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.
-
Dec 23rd, 2006, 08:27 AM
#6
Re: Crystal Reports : How to close database connection? Plz Hlp!
Can you tell me in your code where you are opening the connection,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|