Start New Discussion within our Software Development Community

Morning,
Please a clever person help me,

i am using VS2010, I have a form with a button with the following code.

Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click
        Dim cryRpt As New ReportDocument
        Dim crtableLogoninfos As New TableLogOnInfos
        Dim crtableLogoninfo As New TableLogOnInfo
        Dim crConnectionInfo As New ConnectionInfo
        Dim CrTables As Tables
        Dim CrTable As Table

        cryRpt.Load("c:\CrystalReport2.rpt")

        With crConnectionInfo
            .ServerName = "Localhost"
            .DatabaseName = "MaintSystem"
            .UserID = "mbish"
            .Password = "mbish"
        End With

        CrTables = cryRpt.Database.Tables
        For Each CrTable In CrTables
            crtableLogoninfo = CrTable.LogOnInfo
            crtableLogoninfo.ConnectionInfo = crConnectionInfo
            CrTable.ApplyLogOnInfo(crtableLogoninfo)
        Next

        CrystalReportViewer1.ReportSource = cryRpt
        CrystalReportViewer1.Refresh()
    End Sub
End Class

yet when i load this i STILL get asked for a username and pasword and the databasename is
blank.

Please please please can someone help me?>

This question has already been answered. Start a new discussion instead.