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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN database and custom modulesDNN database and custom modules
Previous
 
Next
New Post
2/3/2012 1:21 PM
 

that provider architecture is designed to use best practices but assumes that you will be using the core database connection - instead if you're using a different database you should provide your own connectionstring (whether this is hardcoded or stored in an appsetting/connectionstring setting is up to you). That way it can access the database but will also run the stored procedures in that database. By using linked queries you can keep all the sprocs within the core database but execute queries against another database (using the server.database.owner.table syntax) which is why it's also an optioin

As Sebastian says you can also use an alternative data source (such as linq or entity framework) as each of those will have their own connection, and hence allow you to run against the other database. This opens up a lot of possibilities e.g. you could use the entity framework against your other database and use WCF dataservices to expose the data as OData calls, in which case you don't even execute queries, but instead service requests - if you take a look at the extension catalog in the core(search for gallery.js) you'll see we use this to execute service requests to extensions.dotnetnuke.com to pull in data and display results.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
3/6/2012 4:47 AM
 
Hi, thanks for your replies. I am retaking now this issue.

My problem is the following.

As I said, I have two DB's:
* The DNN database (A).
* Another database (B), which holds presence control data, maintained by our Windows Forms software. This program collects the workers punches by polling the terminals and stores them in the DB.

I'm sure this is a very usual scenario, so my question must be something most beginners have faced.

I intend to create an employee portal in DNN which, among other things, would allow workers to list their punches and to manually create new ones.

I have been reading a few articles on the Web, as well as a pretty good book about custom modules in DNN; following its instructions, I created a Punches table in the DNN database, which contains the needed fields for the punches data: date and time, card number, etc., plus an ID, a ModuleID and an UserID field, which are used, as I undestand, by DNN. So, there is now a table called "punches" in db A which the same fields as another table also called "punches" in db B, plus ID, ModuleID and UserID.

I have successfully created a custom module that allows users to, for example, list or create their own punches. But the problem is the data they see is in the DNN database (A), not in B, where all the employees and presnce control data resides.

If I want my module to point to database B, do I need to modify the table and create the additional fields ID, ModuleID and UserID in the punches table in db B?

Or should I use a linked server to access the real employees data in db B from db A?

Thanks a lot,

Dani



 
New Post
3/6/2012 5:57 AM
 
So, once I have decided I will use LINQ to connect to the second database, do I need to add the ID, ModuleID and UserID fields to th table I want to query?
 
New Post
3/6/2012 11:41 AM
 
Hi, I'm sorry I guess Cathal already answered my question whe he said that provider architecture is assuming it connects to the DotNetNuke database, not any other one,

Thank you very much.


Daniel Carbonell
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...DNN database and custom modulesDNN database and custom modules


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