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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLinq To SQL as DAL in my ModuleLinq To SQL as DAL in my Module
Previous
 
Next
New Post
5/17/2011 10:25 PM
 
Hello, and thank you,

I am developing a module and I would like to use LinqToSQL as my data access layer for updating my user defined table(s) in my DNN Database.  I have started this module using the Chris Hammond project template.  And I have installed the "source" into my development DotNetNuke website on my local machine.

I have created the LinqToSQL classes in a  sub folder called "LinqData" of the "App_Code" folder and I have added the <add directoryName="LinqData" /> element to my web.config.

When trying to access the LinqToSql classes during my development, I am having various crazy Namespace issues.  If I open my module project directly, I get "The type or namespace LinqDataContext1 could not be found....." when trying to instantiate a private variable in the View.ascx.cs as:

 private LinqDataContext1 db = new LinqDataContext1();

  When I open my website that contains the source for this module and I open the View.ascx page (not the code behind) on the line that I define my linq datasource
   "   <asp:LinqDataSource ID= ... "   I get the following message:

Element "LinqDataSource" is not known element.

Where should I create the LinqToSql classes, in the App_Code folder of my website or in a basic subfolder of my module project.  I am using DotNetNuke 5.5.  Do I need to add any additional "using " references, or do I need to "register" some component at the top of my ASCX file.

Any suggestions and help will be appreciated.  I have tried the Michael Washington tutorial on "Creating a Module with LinqToSQL in DNN."   That is where I go the idea to put the LinqToSql classes in the App_Code folder, but I'm not sure this is correct in this case.

Thank you so much for your help.

Elgin
 
New Post
5/18/2011 3:07 PM
 
Dunno if this helps you with your current problem, but there is a Linq2Sql provider for DNN on codeplex. It supports the {databaseOwner} and {objectQualifier} database qualifiers that you might not get without using the provider.

http://dnnlinqtosqladapter.codeplex.com/

I've never actually used this but I hear it's great. Might be worth checking out.
 
New Post
5/18/2011 3:39 PM
 
Kelly,

Thanks for the suggestion, but yes, I've already looked at that.  And I have implemented that provider into my development website.  However, I am having "namespace" issues and no issues with being connected to the database.

I'm thinking I'm missing a proper "using....; " statement somewhere, but I just don't understand.

Thanks anyway.

Elgin.
 
New Post
5/18/2011 4:04 PM
 
I understand, I was thinking that using something that was already built and tested would help you avoid nuances like the one you are running into.
 
New Post
5/18/2011 4:32 PM
 
Kelly,

Yes, I will probably incorporate that provider into my module if I'm able to go the LinqToSql route.  The module I am building is for uploading and downloading files to and from a website, while at the same time tracking downloads, usage, deletion dates, etc. and allowing particular user access to only certain files.

I know there are probably modules out there that will do most of what I want to do.  But I'm also wanting to learn DotNetNuke and module development at the same time I am learning more about ASP.NET, AJAX , etc.   Yes it's a lot.  But I want to go through the learning pains now.

That's why I'm choosing to develop this from scratch.

Thank you again.

Elgin
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesLinq To SQL as DAL in my ModuleLinq To SQL as DAL in my Module


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