I'm making 3-layer architecture. while accessing database for login the application, i'm having following error.
here is the part of the code for data acess layer
PublicClass DataAccessLayerBaseClassHelper
PublicSharedFunction GetDataAccessLayer() As DataAccessLayerBaseClass
Dim trp As Type = Type.GetType(Globals.DataAccessType, True)
' Throw an error if wrong base type
IfNot trp.BaseType Is Type.GetType("loginTest.DataAccessLayer.DataAccessLayerBaseClass") Then
ThrowNew Exception("Data Access Layer does not inherit DataAccessLayerBaseClass!")
EndIf
Dim dc As DataAccessLayerBaseClass = CType(Activator.CreateInstance(trp), DataAccessLayerBaseClass)
Return dc
EndFunction'GetDataAccessLayer
EndClass'DataAccessLayerBaseClassHelper
EndNamespace'loginTest.DataAccessLayer
here is the code for MoPOSUsers.
'* STATIC METHODS *
PublicSharedFunction Authenticate(ByVal username AsString, ByVal password AsString) AsBoolean
If username IsNothingOrElse username.Length = 0 Then
ThrowNew ArgumentOutOfRangeException("username")
EndIf
If password IsNothingOrElse password.Length = 0 Then
ThrowNew ArgumentOutOfRangeException("password")
EndIf
Dim DBLayer As DataAccessLayerBaseClass = DataAccessLayerBaseClassHelper.GetDataAccessLayer()
Return DBLayer.Authenticate(username, password)
EndFunction'Authenticate
Can u help me in solving this problem?
here is the part of the code for data acess layer
PublicClass DataAccessLayerBaseClassHelper
PublicSharedFunction GetDataAccessLayer() As DataAccessLayerBaseClass
Dim trp As Type = Type.GetType(Globals.DataAccessType, True)
' Throw an error if wrong base type
IfNot trp.BaseType Is Type.GetType("loginTest.DataAccessLayer.DataAccessLayerBaseClass") Then
ThrowNew Exception("Data Access Layer does not inherit DataAccessLayerBaseClass!")
EndIf
Dim dc As DataAccessLayerBaseClass = CType(Activator.CreateInstance(trp), DataAccessLayerBaseClass)
Return dc
EndFunction'GetDataAccessLayer
EndClass'DataAccessLayerBaseClassHelper
EndNamespace'loginTest.DataAccessLayer
here is the code for MoPOSUsers.
'* STATIC METHODS *
PublicSharedFunction Authenticate(ByVal username AsString, ByVal password AsString) AsBoolean
If username IsNothingOrElse username.Length = 0 Then
ThrowNew ArgumentOutOfRangeException("username")
EndIf
If password IsNothingOrElse password.Length = 0 Then
ThrowNew ArgumentOutOfRangeException("password")
EndIf
Dim DBLayer As DataAccessLayerBaseClass = DataAccessLayerBaseClassHelper.GetDataAccessLayer()
Return DBLayer.Authenticate(username, password)
EndFunction'Authenticate
Can u help me in solving this problem?