Mitchel's Forums

Subject: Problem using custom SqlDataProvider
Prev Next
You are not authorized to post a reply.

AuthorMessages
r_honeyUser is Offline
Heavy Poster
Heavy Poster
Posts:77

05/27/2008 11:19 AM  

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:

       
            
                
               

        

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 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???

But I tried it. And even that didnot sorted out the issue.

Please, help!!!

Mitchel SellersUser is Offline
Site Admin/Owner
Guru
Guru
Posts:5644

05/27/2008 11:25 AM  
Yes, that does appear to be the case, I have not worked personally with any customized providers myself...but from what I have read that is the issue.

If you do go this route, be sure to remove the .dll file for the DNN provider from the bin directory!

-Mitchel Sellers
MCITP, MCPD, MCTS
Director of Development
IowaComputerGurus Inc.

View Mitchel Sellers's profile on LinkedIn

3Essentials is my recommended Shared Hosting Provider

This site is hosted on a VPS from HostMySIte.com

Mosso is my recommended cloud computing provider. Use reference code REF-ICG to get $100 off your second month!

To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs
r_honeyUser is Offline
Heavy Poster
Heavy Poster
Posts:77

05/28/2008 8:26 AM  

Finally, I have found a work-around. Although not perfect, it is the best option I could found within the limitations & architecture of DNN.

I have explained it at:

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/230463/scope/posts/threadpage/2/Default.aspx

You are not authorized to post a reply.
Forums >Development Discussion >DotNetNuke > Problem using custom SqlDataProvider



ActiveForums 3.7