Changing object datasources at runtime

Dreadoexece

New Member
I am trying to switch object datasources (objectdatasource1 and objectdatasource2) at runtime and refresh my reportviewer when button1 is clicked. I cant quite figure out how to do this and I am having trouble with getting the code below to work. Any ideas? Thank you\[code\]Dim dataSetName As String = "MyApplication_ModelObject" Dim ds As New MyApplication_ModelObjectTableAdapters.DataTableTableAdapter() Dim rds As New ReportDataSource("MyApplication_ModelObject", ds.GetData()) ReportViewer1.LocalReport.DataSources.Clear() ReportViewer1.LocalReport.DataSources.Add(rds) ReportViewer1.LocalReport.Refresh()\[/code\]
 
Back
Top