Wonder if someone can point me in the right direction. I'm not much of a programmer and I have inherited a DNN website that has some programming issues. A prior developer created this DNN website and in addtion, created a VB project to extend some functionality within the website. The extended functionality primarily involves connectivity to another SQL Server database (not the database used by DNN). In the VB project, there are these references:
- Contacts.dll
- DotNetNuke.dll
- Microsoft.ApplicationBlocks.Data.dll
- And several System.<namespace> references
The VB project compiles error-free, but I am getting a warning, and do not know how to resolve the warning. The warning is as follows:
Warning 'SqlDataProvider' is not CLS-compliant because it derives from 'DataProvider', which is not CLS-compliant.
The warning points to a command-line near the top of the project. It is the 6th line down within the project:
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.ApplicationBlocks.Data
Namespace Contacts
Public MustInherit Class SqlDataProvider
Inherits Contacts.DataProvider
The warning underscores the SqlDataProvider class name. I don't understand how to resolve the warning. If I go ahead and try to view the web page that uses the funtionality within the VB Project, it displays the following error on the page, which I think may go away if I can resolve the warning:
Error: Unable to load the form. Please try it later.
DotNetNuke.Services.Exceptions.ModuleLoadException:
Cannot create an instance of Contacts.SqlDataProvider because it is an abstract class.
---> System.MemberAccessException: Cannot create an instance of Contacts.SqlDataProvider because it is an abstract class.
at System.Reflection.RuntimeConstructorInfo.CheckCanCreateInstance(Type declaringType, Boolean isVarArg)
at System.Reflection.RuntimeConstructorInfo.ThrowNoInvokeException()
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at Contacts.DataProvider.Instance()
at Contacts.CodeRegionController.GetByCountry(String country)
at Contacts.Contactform.formDataInput()
at Contacts.Contactform.Page_Load(Object sender, EventArgs e)
--- End of inner exception stack trace ---
How can I prevent this warning?
Thank you - Steven