I converted the code from VB to C# and web application. However when the module is running, I get the error below. The code is from DataProvider.vb file. I don't know why the error exists as it's casting from a child class to its base class. Any ideas?
Error message:
Error: IFrame is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'DotNetNuke.Modules.IFrame.SqlDataProvider' to type 'DotNetNuke.Modules.IFrame.Data.DataProvider'. ---> System.InvalidCastException: Unable to cast object of type 'DotNetNuke.Modules.IFrame.SqlDataProvider' to type 'DotNetNuke.Modules.IFrame.Data.DataProvider'. at
VB version:
Public Shared ReadOnly Property Instance() As DataProvider
Get
If _provider Is Nothing Then
_provider = CType(Reflection.CreateObject(ProviderType, ProviderNamespace, ""), DataProvider)
End If
Return _provider
End Get
End Property
C# version:
public static DataProvider Instance
{
get
{
if (_provider == null)
{
_provider = (DataProvider) (Reflection.CreateObject(ProviderType, ProviderNamespace, ""));
}
return _provider;
}
}