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 ...Can I create a Separate Data Layer?Can I create a Separate Data Layer?
Previous
 
Next
New Post
2/12/2007 5:14 PM
 

Short version: Can I create a datalayer via a dataset in the App_Code folder, connect it to a ObjectDataSource (ODS), and then connect that source to a gridview in a testpage/module? I try it and the dataset does not appear when I configure the ODS like it normally does!!

 

Long Version:

Before I was recently introduced to DNN, I was developing pages with VS.NET

A few months agao I had worked through one of Scott Mitchell's tutorials, 'Working with Data in ASP.NET 2.0 :: Creating a Data Access Layer' and was happily (and quickly) creating strongly typed data layers and binding them to GridViews through objectdatasources.

Then I discovered DNN and wow, what a project. I decided to give it a go and try to use it for a project at work. I have worked through a bunch of newbie learning stumbling blocks, and while studying DNN, saw that the 'Provider Model' is used as the DAL+. To be honest, I don't understand it. I think that there is a data provider, asqldtatprovider, and a ton of SPs that all somehow interact. But I didn't get too concerned about it because I figured I could eventually simply add a datalayer in the form of an XSD file in the App_Code folder, as Scott Mitchell does, and then I could go on as usual. WRONG!!

Today I tried it andnow I am panicking because I have made promises at work but now fear I have run into the dreaded dead end. I added a gridview to a test page in the root, created a dataset, in the App_code folder, and when I try to create the datasource, the dataset does not appear in the dropdown list as it normally does.

Does anyone have any experience in this area? If not, I need help understanding how I can create methods to manipulate data that I will be adding in additional data tables in the db.

I am using DNN 4.3.5 with VS.NET 2005

 

 
New Post
2/12/2007 5:54 PM
 

While I can't  answer your short questions, I may have some help on providing data displays via a gridview.  There are several free modules that can help - first of all there is the report module within DNN that can display data.  Aslo see SQLView from DNNStuff , and SQLGridSelectedView at www.tressleworks.ca  

Any of these three modules will help display data.  

As for the  Separate Data Layer - you do not have to follow the DNN model - it is a recommendation and provides a known working environment.  Please provide some specific error detail that you are encountering as this is the best way to determine what is going on. 

Hope this helps - Paul.

 
New Post
2/12/2007 7:11 PM
 

Thanks for the reply Paul. I realized that if I simply switch to HTML mode instead of the designer in VS.NET, and then manually add 'typename="nameOfMyTableAdapters", the ObjectDataSource then recognizes the dataset and its methods.

Without the manual addition, the dataset is not recognized for some reason. I will take a look at your site. Thanks again

 

 
New Post
2/12/2007 8:26 PM
 
Tigris7 wrote

Short version: Can I create a datalayer via a dataset in the App_Code folder, connect it to a ObjectDataSource (ODS), and then connect that source to a gridview in a testpage/module? I try it and the dataset does not appear when I configure the ODS like it normally does!!

See

  • Super-Simple Module (DAL+)
  • Super-Fast Super-Easy Module (DAL+)
  • for examples of using the DotNetNuke to connect to the database. You will use far less code using this method than if you used any other method. If you need to conect to another database see: Connecting to another database

    Super-Fast Super-Easy Module (DAL+) shows an example using the DAL+ and Object Data Sources. Your custom datasource will not be recognized automatically in the designer. this is a bug in ASP.NET not DotNetNuke. You have to create the control by placing a declaration in the source of your .ascx wit the typename of your class. Like:

    <asp:ObjectDataSource ID="ObjectDataSource_ThingsForSale" runat="server" DataObjectTypeName="YourCompany.Modules.ThingsForSale.ThingsForSaleInfo"
    OnInit="Page_Load" TypeName="YourCompany.Modules.ThingsForSale.ThingsForSaleController"
    </asp:ObjectDataSource>

    After that you can switch back to the designer and the Object Data Source wizrd should work like normal.



    Michael Washington
    http://ADefWebserver.com
    www.ADefHelpDesk.com
    A Free Open Source DotNetNuke Help Desk Module
     
    Previous
     
    Next
    HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Can I create a Separate Data Layer?Can I create a Separate Data Layer?


    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