I tried following the examples in Crystal Reports Encyclopedia, Volume 2 (Listing 17-13 and 17-15) to create a DLL, then use the Database Expert in a blank report to connect to the DLL.
Crystal Reports gives me: "Logon failed. Details: mscorlib : Exception has been thrown by the target of an invocation."
What am I doing wrong (details below)?
Thank you in advance for your assistance!
-------------------------------------------------------------
My DLL created in Visual Studio 2008 is:
Imports
System.Data
Imports System.Data.OleDb
Public
Class CM_Wizard
Public Shared Function Get_Wizard_1() As IDataReader
Dim str_OleDB_Connection_Provider As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='C:\!CV Share\CV_GDF.mdb'"
Dim str_Select As String = "SELECT * FROM tblPartClasses_3_5"
Dim myOleDBConnection As OleDbConnection = New OleDbConnection(str_OleDB_Connection_Provider)
myOleDBConnection.Open()
Dim myOleDBCommand As OleDbCommand = New OleDbCommand(str_Select, myOleDBConnection)
Dim myIDataReader As IDataReader = myOleDBCommand.ExecuteReader
Return myIDataReader
End Function
End
Class
----------------------------------------------
Within Crystal Reports 2008:
• Open blank report.
• Open Database Expert.
• Select 'ADO.NET (XML)' -> Make New Connection.
• Open "CM_Wizard.dll".
• Select Class Name "CM_Wizard.CM_Wizard".
• "CM_Wizard.CM_Wizard" appears under 'ADO.NET (XML), with "Get_Wizard_1" below it.
• The icon next to "Get_Wizard_1" is a box with three rows of waves.
• Double-click on "Get_Wizard_1" and I get the mscorlib error message.
------------------------------------------------
George
Edited by CIWGeorge - 15 Jun 2009 at 2:17pm