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.0Question about cross module dataproviderQuestion about cross module dataprovider
Previous
 
Next
New Post
5/22/2007 4:32 AM
 

I am developing a number of custom modules that all connect to the same external (non-DNN) SQL database. Rather than developing a dataprovider for each individual module, I want to create a common, cross-module dataprovider that is used by all the modules. Even some of the business layer logic is common so it could reside there too.

What is the best way of setting this up? Is this the right approach? Has anyone done it and can point me to some sample code to get me started?

Thanks in advance!

 

 

Felix

 

 
New Post
5/22/2007 7:42 AM
 

Perhaps this can help:

Connecting to another database



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
5/22/2007 9:30 AM
 

I personally would (and always do) skip the DNN DAL model.  It's a personal preference.  Explore some of the DAL layer generation tools like RapTier, MyGeneration, and CodeSmith.  Personally I developed my own MyGeneration templates that are very similar to the code generated by RapTier.  Create your layer in a .net class library which creates a DLL, then you simply reference the dll from all your modules.  MyGeneration (and the commercial version EntitySpaces) has a framework called DooDads which is also nice.

Good Luck,

Mike!

 
New Post
6/8/2007 7:35 AM
 

Thanks both of you Michael and Mike

I have obtained Mygen and created the Info & Controller classes for my external DB. What I want in the end is a separate DLL that has the Biz & DB layer for my external DB. I do not need a extra DAL abstraction layer, the DAL+ model is sufficient.

I have now some problems with the "plumbing". Within the DB class I want to use the CBO.Fillxx routine from DNN. In the code below I get an error

Error 2: 'Instance' is not a member of 'Provider'. 

Public Function GetCustomerByCustomerID(ByVal lCustomerID As Integer) As CustomerInfo
   Return CType(CBO.FillObject(Provider.Instance().GetCustomerByCustomerID(lCustomerID), GetType(CustomerInfo)), CustomerInfo)
End Function

What will I need to place instead of the word 'Provider'. I tried to reference the class in all sorts of ways. If I fully reference it I get an error "Error 2 'GetCustomerByCustomerID' is not a member of 'DotNetNuke.Data.DataProvider', even though there is no reference to it. The DBprovider class must be instantiated here, but I can't quite work out how to get it happening.

I think it may all be a problem with the namespace. The Biz and Info objects are in MyCompany.Data and the provider in MyCompany.Data.Provider . Is this correct?

Any help much appreciated...

Felix

 
New Post
6/8/2007 9:15 AM
 

 

I really like Michael's comment in his tutorial, connect to your other database just like any other asp.net application.

Well, I suggest you look at SubSonic, it has a nice way to get all the common DAL stuff for you pretty easilly.

There are a number of tutorials, including the day in the life, that shows how to build your DAL and package into a seperate DLL for your project.

I plan on blogging  a series of DNN/Subsonic related posts on this soon.

Also check out this DNN module, that gets you easy CRUD support for any table in your schema via the SubSonic autoscaffold control.


Jim www.walkspoiled.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Question about cross module dataproviderQuestion about cross module dataprovider


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