For the last 3-4 hours, I have been trying to use my custom Sql Data Provider, but DNN is picking up its own DataProvider every time.
I have removed DNN DataProvider's entry from web.config & added my Provider as follows:
<data defaultProvider="SqlDataProvider">
<providers>
<clear/>
<add name="SqlDataProvider" type="Imbibe.Provider.SqlDataProvider, Imbibe.Provider" connectionStringName="SiteSqlServer" upgradeConnectionString="" providerPath="~\bin\" objectQualifier="" databaseOwner="dbo"/>
</providers>
</data>
But DNN is using its own provider. Just to be sure, that my provider is not being used, I am throwing an Exception in the first line of my Provider constructor, but the site opens up cleanly, without any exceptions, and all data being showed properly. I have been able to supply my custom Profile provider, but somehow the DataProvider is not working my way.
Please help!!!
I analyzed the abstract Data Provider & found there the following code:
Private Const ProviderType As String = "data" ' maps to <sectionGroup> in web.config
Private Const ProviderNamespace As String = "DotNetNuke.Data" ' project namespace
Private Const ProviderAssemblyName As String = "" ' project assemblyname
' singleton reference to the instantiated object
Private Shared objProvider As DataProvider = Nothing
' constructor
Shared Sub New()
CreateProvider()
End Sub
' dynamically create provider
Private Shared Sub CreateProvider()
objProvider = CType(Framework.Reflection.CreateObject(ProviderType, ProviderNamespace, ProviderAssemblyName), DataProvider)
End Sub
The abstract provider is not picking up the Concreate provider's namespace from web.config. This coupled with the following thread:
http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/171688/scope/posts/Default.aspx
make me believe I need to put my custom provider also in the namespace DotNetNuke.Data. Is that so???
Please, help!!!