Databind' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'

StackOverflow https://stackoverflow.com/questions/2542146

  •  23-09-2019
  •  | 
  •  

문제

ive being trying to cope with this problem but still. I need your help. Im having the following error message:

Databind' is not a member of 'CrystalDecisions.Windows.Forms.CrystalReportViewer'

in my code:

Dim rpt As New CrystalReport1() Dim da As New SQLiteDataAdapter Dim ds As New presbydbDataSet

        'Dim cmd As New SQLiteCommand("SELECT personal_details.fn, training.training_level FROM personal_details INNER JOIN training ON Staff_ID WHERE personal_details.staff_ID='" + detailsFrm.Label13.Text + "'", conn)




Dim cmd As New SQLiteCommand("SELECT * FROM personal_details WHERE personal_details.staff_ID='" + detailsFrm.Label13.Text + "'; SELECT * FROM training WHERE training.staff_ID='" + detailsFrm.Label13.Text + "'", conn)
        cmd.ExecuteNonQuery()
        da.SelectCommand = cmd
        da.Fill(ds)
        rpt.SetDataSource(ds)
        rpt.Subreports.Item("personal_detailsRpt").SetDataSource(ds.Tables("personal_details"))
        rpt.Subreports.Item("trainingRpt").SetDataSource(ds.Tables("training"))
        CrystalReportViewer1.ReportSource = rpt
        CrystalReportViewer1.DataBind()

Im using vb.net and these are the imports Im using:

Imports System.Data.SQLite
Imports System.Configuration
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.ReportAppServer

Please how can I get rid of this error? Thanks for answering

도움이 되었습니까?

해결책

The Windows Forms CrystalReportViewer class doesn't have a DataBind method - simply remove that line and it should work.

DataBind is typically used with ASP.NET controls.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top