locked
Crystal report viewer 2010 RRS feed

  • Question

  • Hi,

    i am developing vb.net application.my problem connect crystal report and crystal report viewer 2010 the following error bellow

    Error:

    DataSourceException was unhandled

    Failed to load database information
    Error in File Crystalreport1 {6FD86467-7732-4C70-8711-591E157F87F3}.rpt:
    Fail to load database information

    My code:

    Imports CrystalDecisions.CrystalReports.Engine
    Imports CrystalDecisions.Shared

    Dim rpt As New ReportDocument
    Dim ds As New DataSet
    Dim strpath As String

     Try

    obj.connect()
    q = "SELECT * FROM tblPayment"
    ds = obj.dset(q)
    If ds.Tables(0).Rows.Count > 0 Then
    strpath = Application.StartupPath & "\" & "CrystalReport1.rpt"
    rpt.Load(strpath)
    rpt.SetDataSource(ds.Tables("rrr"))
    Me.CrystalReportViewer1.ReportSource = rptds.Clear()

    Else
    End If
    Catch ex As Exception
    End Try

    Any one pls help me

    • Moved by Min Zhu Tuesday, July 10, 2012 8:57 AM (From:.NET Platform Architecture Development Discussions)
    Monday, July 9, 2012 7:33 AM

All replies

  • I would recomend you to debug your code identify which line of code is causing the error. I doubt rptds.Clear() of below line is the real culprit. I am not sure what this rptds.Clear() method would do here.

    Me.CrystalReportViewer1.ReportSource = rptds.Clear()

    Insted it should be

    Me.CrystalReportViewer1.ReportSource = rpt
    Another reason could be your connection string is wrong. Have you checked your Database Connection String? Can you make sure it is 100% correct

    Lingaraj Mishra

    Monday, July 9, 2012 12:24 PM
  • Hi Krish,

    Welcome to the MSDN Forum.

    For Crystal report issue, please visit here: http://forums.sdn.sap.com/forum.jspa?forumID=313 

    Thank you.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 10, 2012 9:53 AM