每当我运行程序时,它就会显示“报告没有表”。我刚刚添加了名为“ CrystalReport1”的Crystal Report,并像这样编码,然后运行该程序。
Dim con As New SQLiteConnection
Dim ds As New DataSet
Dim conStr As String = "Data Source=" + Application.StartupPath + "\mydb.db3; Version=3;"
con.ConnectionString = conStr
con.Open()
Dim da As New SQLiteDataAdapter("My Custom Query", conStr)
da.Fill(ds, "myTbl")
'Also tried like this
'Dim dt as New DataTable
'da.Fill(dt)
'ds.Tables.Add(dt)
Dim cr As New CrystalReport1
cr.SetDataSource(ds.Tables(0))
CrystalReportViewer1.ReportSource = cr
CrystalReportViewer1.Refresh()