Results 1 to 6 of 6

Thread: Crystal Reports : How to close database connection? Plz Hlp!

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    14

    Smile 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.

  2. #2
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    14

    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,

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Crystal Reports : How to close database connection? Plz Hlp!

    Put This Line at the above your code.
    VB Code:
    1. Dim oRpt As CrystalDecisions.CrystalReports.Engine.ReportDocument = New CrystalDecisions.CrystalReports.Engine.ReportDocument

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    14

    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.

  6. #6
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Question 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
  •  



Click Here to Expand Forum to Full Width