By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,446 Members | 3,090 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,446 IT Pros & Developers. It's quick & easy.

Crystal Report - Multiple database connections

P: n/a

I have a simple crystal report. Report is displayed using CrystalReportViewer control in a web form. It works fine.
There is one problem with the database connection logic. Whenever I navigate thru' report pages, it creates a new (additional) database connection. Is there any solution to avoid this?

The code is -
************************************************** ***********
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Ini
'CODEGEN: This method call is required by the Web Form Designe
'Do not modify it using the code editor

'Create an instance of the strongly-typed report objec
crReportDocument = New Report1(

'Create a new instance of the connectioninfo object an
'set its propertie

crConnectionInfo = New ConnectionInfo(
With crConnectionInf
.ServerName = "myServer
.DatabaseName = "orcl
.UserID = "scottr
.Password = "tiger
End Wit

'Get the tables collection from the report objec
crDatabase = crReportDocument.Databas
crTables = crDatabase.Table

'Apply the logon information to each table in the collectio
For Each crTable In crTable
crTableLogOnInfo = crTable.LogOnInf
crTableLogOnInfo.ConnectionInfo = crConnectionInf

CrystalReportViewer1.ReportSource = crReportDocumen

End Su
************************************************** *************

Please hel


Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.