HOME > .NET Framework > Forum > รบกวนขอคำแนะนำแก้ไขปัญหา เมื่อรันโปรแกรมบน client ขึ้น "Failed to open the connection. Failed to open the connection crystal report "
รบกวนขอคำแนะนำแก้ไขปัญหา เมื่อรันโปรแกรมบน client ขึ้น "Failed to open the connection. Failed to open the connection crystal report "
รบกวนขอคำแนะนำ เมื่อเรียกโปรแกรมผ่าน browser บนเครื่อง client ขึ้นข้อความ "Failed to open the connection. Failed to open the connection crystal report " ดังรูป
Dim cryRpt As New ReportDocument()
Dim crtableLogoninfos As New TableLogOnInfos()
Dim crtableLogoninfo As New TableLogOnInfo()
Dim crConnectionInfo As New ConnectionInfo()
Dim CrTables As Tables
cryRpt.Load(MapPath("CrystalReport.rpt"))
crConnectionInfo.ServerName = "ICELand"
crConnectionInfo.DatabaseName = "MiniOPT"
crConnectionInfo.UserID = "sa"
crConnectionInfo.Password = "121212"
CrTables = cryRpt.Database.Tables
For Each CrTable As CrystalDecisions.CrystalReports.Engine.Table In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(crtableLogoninfo)
Next
CrystalReportViewer1.ReportSource = cryRpt
CrystalReportViewer1.RefreshReport()