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:

[B]
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
            tbCurrent.ApplyLogOnInfo(tliCurrent)
        Next tbCurrent

        With crvAll
            .DisplayGroupTree = False
            .ReportSource = rptAll
            .Show()
            .Zoom(1)
        End With
    End Sub[/B]

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.