Running a Report from a DataSet/DataTable

Stephen

Member
Joined
Feb 22, 2006
Messages
15
Programming Experience
Beginner
I am currently trying to run a crystal report from a DataSet with the following code I found:

'create report object
Dim rpt As New ReportDocument
'load the report
rpt.Load(MyReportLocation)

'create dataset
dim ds as new DataSet
'get your data
dim dt as DataTable = DatabaseClass.GetSomeQuery()
'add your table to the dataset
ds.Tables.Add (dt)

'this is important : table name = name in your XSD
dt.TableName = "MyTable"
'add the dataSET to the report
rpt.SetDataSource(ds)

I am pretty new to VB.NET and am not sure what they mean by DatabaseClass. When I use the DataTable name I can see in the Class View it does not recognise it.

What am I doing wrong? :confused:
 
Back
Top