Skip to Content
0
Aug 10, 2023 at 11:14 AM

Database connection in VB.net

116 Views Last edit Sep 22, 2023 at 12:12 AM 3 rev

I have a vb.net program that displays a crystal report. On my machine it works fine, but on the client's machine when I show the report it shows the database connection, without the database.

image.png

But I give it by code.

cryRpt = CrystalReportViewer1.ReportSource

For Each crTable In cryRpt.Database.Tables

crTableLogonInfo = crTable.LogOnInfo

crTableLogonInfo.ConnectionInfo.ServerName = "aaaa"

crTableLogonInfo.ConnectionInfo.DatabaseName = "class"

crTableLogonInfo.ConnectionInfo.UserID = "aaaa"

crTableLogonInfo.ConnectionInfo.Password = "aaaa"

crTableLogonInfo.ConnectionInfo.Type = ConnectionInfoType.Query crTableLogonInfo.ConnectionInfo.IntegratedSecurity = False

crTable.ApplyLogOnInfo(crTableLogonInfo)

Next

CrystalReportViewer1.ReportSource = cryRpt CrystalReportViewer1.Refresh()

Can anyone help? thank you

Attachments

image.png (8.6 kB)