Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem using custom Data ProviderProblem using custom Data Provider
Previous
 
Next
New Post
5/27/2008 7:50 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:

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

 
New Post
5/27/2008 11:27 AM
 

Anyone can prvide some help. I have stilll not been able to sort this out. And this is really important!!!

 
New Post
5/27/2008 12:09 PM
 

I've been thinking about your issue on and off over the last hour, and your approach seems correct (or at least what I would do initially if I were trying to accomplish the same task).

DNN can be picky about the fully qualified object name used in a provider (I believe you need a .Data at the end of your object).  However, this can't be the problem, because DNN isn't telling you that it CAN'T create the provider, it's creating the WRONG one.  If it were a namespace issue as you suggested, I would expect to see an exception relating to a failure to instantiate the provider in the first place.

If I were debugging this issue, my next step would be to put a breakpoint in the core code where the dataprovider is instantiated.  Do you have a dev setup where you can debug the core?

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
5/27/2008 12:35 PM
 

Brandon Haynes wrote

(I believe you need a .Data at the end of your object)

Data at the end of my Class name or Namespace in which the class resides???

Brandon Haynes wrote

Do you have a dev setup where you can debug the core?

Although I have a dev setup with debugging capabilities, and I am already  trying to do that, but now the problem is that when I try to run the Source project, I get a FileIOPermission Exception in FileBasedCachingProvider project.

I have done my best to find its cause, but could not understand either the cause or solution. And now, I find myself messing up with this situation!!!

 
New Post
5/27/2008 1:48 PM
 

I believe you do have to use the DotNetNuke.Data namespace and make sure you inherit from the core dataprovider.

Everything else looks correct - can you give some more information as to what your setup looks like.

a) are you using WAP model or WSP - do you have the dll in the bin folder if using WAP model?
b) what is the dll name?
c) What is the namespace and class name you're using?
d) If you're creating your own custom sql dataprovider - is there a reason why the core supplied one doesnt work - reason I'm asking is because could there be a different way in accomplishing what you're trying to do?


Sanjay


AcuitiDP - Oracle Data Provider for DotNetNuke
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problem using custom Data ProviderProblem using custom Data Provider


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out