Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the below code to open the crystal report in my project(vb.net 2010 & 'sql2005). Now i want to change the Server. In my new server using sql2008. when Iam 'going to open reports, the report is not open and an error like,(Failed to open 'connection. details:[database vendor code:17].temp-od6b541a-00c4-48df-94a1-'517674a0865f{9D63448D-2D45-4F1D-8BA0-BDD90DBFE35}.rpt) is obtained .

Is anybody 'Knows the solution Help me please.

VB
Dim sQuery As String
Dim cryRpt As New ReportDocument
      Dim DA As SqlDataAdapter
      Dim ds As New DataSet
'JDLCommon.ModCommon.strConString (Data Source=192.168.1.100;Initial 'Catalog=JDLapps;User ID=sa;Password=sql2005).This is my connection string that 'defined in app.config
      Try
         SourceSQL="select Query"
          cryRpt = rptDoc
          cryRpt.SetDatabaseLogon("sa","sql2005")

          DA = New SqlDataAdapter(SourceSQL, JDLCommon.ModCommon.strConString)
          DA.Fill(ds, "tablename")
          cryRpt.SetDataSource(ds.Tables("tablename"))
          rptViewer.ReportSource = cryRpt

          'rptDoc.VerifyDatabase()
          'rptViewer.co
          JDLCommon.modReportCommon.InitializeReports(rptViewer)
          docName = documentname & rptname.Substring(3)
          rptViewer.Refresh()
Posted
Updated 23-Apr-12 1:32am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900