Dim Var_ds as String = DsVarName & ".xsd" Dim da As SqlDataAdapter = New SqlDataAdapter(comm) Dim myDS As New DataSet(Var_ds)
Public Function CreateObjectInstance(ByVal objectName As String) As Object ' Creates and returns an instance of any object in the assembly by its type name. Dim obj As Object Try If objectName.LastIndexOf(".") = -1 Then 'Appends the root namespace if not specified. objectName = [Assembly].GetEntryAssembly.GetName.Name & "." & objectName End If obj = [Assembly].GetEntryAssembly.CreateInstance(objectName) ---- > after this where object returns "Nothing" Catch ex As Exception obj = Nothing End Try Return obj End Function
Dim da As SqlDataAdapter = New SqlDataAdapter(comm) Dim myDS As New GR01_ds() <------ this is for GR01_rpt report, what i want to do is, Dim myDS As New Var_Ds() wherein Var_Ds will represent any DataSet that is for a specific report, GR01_ds is for GR01_rpt Report, Gr02_ds is for GR02_rpt Report, Gr03_ds is for GR03_ rpt Report, up to GR23_ds If User selects GR-07 Report, Var_Ds will be GR07_ds, my code will then be like, Dim da As SqlDataAdapter = New SqlDataAdapter(comm) Dim myDS As New Var_ds() da.Fill(myDS, myRPT) rpt.SetDataSource(myDS) ReportMain.CrystalReportViewer2.ReportSource = rpt ReportMain.CrystalReportViewer2.Refresh()
CrystalReportsException was unhandled by user code.-- Load Failed.