Click here to Skip to main content
16,005,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Need help with VB web form Pin
Derek G8-Jan-06 19:22
Derek G8-Jan-06 19:22 
GeneralRe: Need help with VB web form Pin
Christian Graus9-Jan-06 10:59
protectorChristian Graus9-Jan-06 10:59 
GeneralRe: Need help with VB web form Pin
Derek G9-Jan-06 19:22
Derek G9-Jan-06 19:22 
GeneralRe: Need help with VB web form Pin
Derek G9-Jan-06 19:27
Derek G9-Jan-06 19:27 
GeneralRe: Need help with VB web form Pin
Christian Graus10-Jan-06 9:51
protectorChristian Graus10-Jan-06 9:51 
Questioncode for mobile Pin
sandip kevadiya8-Jan-06 11:44
sandip kevadiya8-Jan-06 11:44 
AnswerRe: code for mobile Pin
Christian Graus8-Jan-06 12:49
protectorChristian Graus8-Jan-06 12:49 
QuestionDynamically Create Provider in DotNetNuke Pin
robprogger8-Jan-06 6:20
robprogger8-Jan-06 6:20 
Hello!

I am developing a cutom module in DotNetNuke.
I have written the correct NameSpace and Assemblyname but I
just keep getting this error in Visual Studio.

Errormessage:
"An unhandled exception of type 'System.MemberAccessException' ocurred
in mscorib.dll
Additional information: Cannot Create an abstract class."

Exception:
System.TypeInitializationException
----Inner exception: System.MemberAccessException
----Message: "Cannot create an abstract class."
----Source: mscorlib

Code:
Imports System<br />
Imports System.Web.Caching<br />
Imports System.Reflection<br />
<br />
Namespace INVID.DNN.Modules.HelloWorld.Data<br />
<br />
    Public MustInherit Class DataProvider<br />
<br />
#Region "Shared/Static Methods"<br />
        ' singleton reference to the instantiated object <br />
      Private Shared objProvider As DataProvider = Nothing<br />
<br />
        ' constructor<br />
        Shared Sub New()<br />
            CreateProvider()<br />
        End Sub<br />
<br />
        ' dynamically create provider<br />
       '  This sub gets called, It is calling the methods that will raise the exception<br />
      Private Shared Sub CreateProvider() <br />
         objProvider = CType(Framework.Reflection.CreateObject( _<br />
            "data", _<br />
            "INVID.DNN.Modules.HelloWorld.Data", _<br />
            "INVID.DNN.Modules.HelloWorld"), DataProvider)<br />
      End Sub<br />
<br />
      ' return the provider<br />
      Public Shared Shadows Function Instance() As DataProvider<br />
         Return objProvider<br />
      End Function<br />
#End Region<br />
    End Class<br />
End Namespace


Code that is called in (The Step were it goes wrong) Components\Shared\Reflection.vb:

 ' dynamically create an object from a TypeName using a CacheKey<br />
        Public Shared Function CreateObject(ByVal TypeName As String,  _<br />
            ByVal CacheKey As String) As Object<br />
<br />
            If CacheKey = "" Then<br />
                CacheKey = TypeName<br />
            End If<br />
<br />
            ' use the cache for performance<br />
            Dim objType As Type = CType(DataCache.GetCache(CacheKey), Type)<br />
<br />
            ' is the type in the cache?<br />
            If objType Is Nothing Then<br />
                Try<br />
                    ' use reflection to get the type of the class<br />
                    objType = Type.GetType(TypeName, True)<br />
                    ' insert the type into the cache<br />
                    DataCache.SetCache(CacheKey, objType)<br />
                Catch exc As Exception<br />
                    ' could not load the type<br />
                    LogException(exc)<br />
                End Try<br />
            End If<br />
            ' dynamically create the object<br />
            Return Activator.CreateInstance(objType) ' This line raises the error mentioned before<br />
        End Function



Any help on this error will be much appreciated!
Best regards rob_pro@hotmail.com
AnswerRe: Dynamically Create Provider in DotNetNuke Pin
Dave Kreskowiak8-Jan-06 7:54
mveDave Kreskowiak8-Jan-06 7:54 
GeneralRe: Dynamically Create Provider in DotNetNuke Pin
robprogger8-Jan-06 21:48
robprogger8-Jan-06 21:48 
AnswerRe: Dynamically Create Provider in DotNetNuke Pin
Colin Angus Mackay8-Jan-06 11:11
Colin Angus Mackay8-Jan-06 11:11 
AnswerRe: Dynamically Create Provider in DotNetNuke Pin
robprogger8-Jan-06 22:00
robprogger8-Jan-06 22:00 
QuestionReports and Non-database data sources? Pin
Sam Marrocco8-Jan-06 6:17
Sam Marrocco8-Jan-06 6:17 
AnswerRe: Reports and Non-database data sources? Pin
Duncan Edwards Jones8-Jan-06 10:52
professionalDuncan Edwards Jones8-Jan-06 10:52 
GeneralRe: Reports and Non-database data sources? Pin
Sam Marrocco8-Jan-06 11:03
Sam Marrocco8-Jan-06 11:03 
GeneralRe: Reports and Non-database data sources? Pin
Duncan Edwards Jones8-Jan-06 11:27
professionalDuncan Edwards Jones8-Jan-06 11:27 
GeneralRe: Reports and Non-database data sources? Pin
Sam Marrocco8-Jan-06 13:43
Sam Marrocco8-Jan-06 13:43 
GeneralRe: Reports and Non-database data sources? Pin
Duncan Edwards Jones24-Jan-06 6:00
professionalDuncan Edwards Jones24-Jan-06 6:00 
QuestionVB.NET, GDI+, Out of memory? Pin
cknipe8-Jan-06 5:46
cknipe8-Jan-06 5:46 
AnswerRe: VB.NET, GDI+, Out of memory? Pin
Daniel Grunwald8-Jan-06 7:07
Daniel Grunwald8-Jan-06 7:07 
AnswerRe: VB.NET, GDI+, Out of memory? Pin
Dave Kreskowiak8-Jan-06 7:50
mveDave Kreskowiak8-Jan-06 7:50 
GeneralRe: VB.NET, GDI+, Out of memory? Pin
cknipe8-Jan-06 10:17
cknipe8-Jan-06 10:17 
GeneralRe: VB.NET, GDI+, Out of memory? Pin
cknipe8-Jan-06 11:05
cknipe8-Jan-06 11:05 
GeneralRe: VB.NET, GDI+, Out of memory? Pin
Christian Graus8-Jan-06 11:32
protectorChristian Graus8-Jan-06 11:32 
GeneralRe: VB.NET, GDI+, Out of memory? Pin
cknipe8-Jan-06 11:44
cknipe8-Jan-06 11:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.