anyone can me that I'm using VB.net 2003 and crystal Report 9.

Here is my DB structure:
Server = server123
Database 1: TestDB1
table :users

Server= server123
Database 2: TestDB2
table :users

In the design time in crystal report , i used the connection which connect to TestDB1.users

but in VB coding, i want to connect testDB2. But why the data is now showing data of TestDB1.users and not the data of testDB2.users . Why?.... anyone can help me .....thanks a lot

My coding is here:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim rptAll As New CrystalDecisions.CrystalReports.Engine.ReportDocument
        Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

        rptAll.Load(Application.StartupPath & "\Report1.rpt")

        For Each tbCurrent In rptAll.Database.Tables
            tliCurrent = tbCurrent.LogOnInfo
            With tliCurrent.ConnectionInfo
                .ServerName = "server123"
                .UserID = "user1"
                .Password = "123456"
                .DatabaseName = "TestDB2"
            End With
        Next tbCurrent

        With crvAll
            .DisplayGroupTree = False
            .ReportSource = rptAll
        End With
    End Sub[/B]

Edited by superbt: n/a

8 Years
Discussion Span
Last Post by udith85

first of all check ur userID, Passwd and server name..then run it again....i ment connectivity

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.