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...DNN Platform (o...DNN Platform (o...BrandonHaynes.ModelAdapter.DotNetNukeDataContextBrandonHaynes.ModelAdapter.DotNetNukeDataContext
Previous
 
Next
New Post
2/18/2009 6:48 AM
 

 HI

So, I created a module using BrandonHaynes.ModelAdapter.DotNetNukeDataContext and it seems to work fine in development.

I then, created another DNN 5.x.x installation and moved the relevant files of the module over to the new DNN install and moved the DLL ffor my module into the new bin.

I opened the new DNN website in VS2008 and had it upgrade the site to .net 3.5. 

I moved the LINQ related code files under App_Code [I am not sure if this is the right thing to do]

I am now getting the error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

 

Compiler Error Message: BC30002: Type 'System.Data.Linq.Mapping.DatabaseAttribute' is not defined.

 

Source Error:

 

 

 

Line 24: Namespace LINQTest

Line 25:

Line 26: <System.Data.Linq.Mapping.DatabaseAttribute(Name:="DNN5LINQTest")>  _

Line 27: Partial Public Class LINQTestPMDataContext

Line 28: Inherits BrandonHaynes.ModelAdapter.DotNetNukeDataContext

 

Any help greatly appreciated and desperately needed.
 
Thanks
 

 


 

 
New Post
2/19/2009 9:33 AM
 

Could be that your new site's web.config does not have all the necessary entries for Linq. I know its supposed to as it is DNN 5.x, but might be worth comparing it to your working site. Alternatively, have a look at this module which automatically adds the necessary LINQ references to the web.config:

http://www.adefwebserver.com/DotNetNukeHELP/Misc/LinqPrep

Its written for DNN 4 but it might help you.

 
New Post
2/19/2009 9:41 AM
 

If you upgrade your site using Visual Studio, the DNN 5 upgrade option in Host Settings may not work correctly for the linq attributes. The module at:

http://www.adefwebserver.com/DotNetNukeHELP/Misc/LinqPrep

Can also be used for DNN5



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
2/19/2009 2:40 PM
 

 Hi

Thanks for your response Micheal. I was able to get it working after opening up the web project using VS 2008.  I also had to change the connection string value being used in the DBMLDesigner.vb to use SiteSQLServer.

Another thing that gets me very concerned is having to deploy code file to DBMLDesigner.vb to any client DNN installation. I am not sure if I were to create this module and put it up for sale on snowcovered, and the connection string used in that users install is not SiteSqlServer

Anyone else have a way around having to distribute DBMLDesigner.vb code files with modules. I tried to register on Effority.com to download their sample to see how they do it, but I never got the verification email from them.

Thanks

 

 


 

 
New Post
2/19/2009 4:14 PM
 

Hi DNN Coder,

The DotNetNukeDataContext, used as a base class for adapted L2S models, contains two constructors that automatically pick up the runtime DotNetNuke connection string.  These are prototyped as DotNetNukeDataContext(MappingSource mapping) and DotNetNukeDataContext(MappingSource mapping, IModelAdapter adapter).  Your super class will need to call one of these overloads to automatically use the current connection string.  If you do not, you will have to manually handle this yourself (by passing your own connection, as it sounds like you are doing).

If you want to construct the base DotNetNukeDataContext yourself, I would recommend passing DotNetNuke.Common.Utilities.Config.GetConnectionString().  This is the value used by the underlying object.  However, using one of the constructors that does this for you is the way to go, if at all possible.

Take a look at your designer file and ensure that the empty constructor reads something like:

public MyDataContext() :
      base(mappingSource)
      {
      OnCreated();
      }
Unfortunately the designer does not well-support this particular construction method, and may be "helping" by generating the constructor incorrectly.  I recall giving serious consideration to this issue, where I had to choose whether to swallow the designer-generated connection string.  In the end the purist in me was just too offended to go that route.
 
I'm not a fan of deploying any code files to an end installation, especially commercial modules.  Consider compiling your data model in a separate assembly (or inside your current one) and deploying just that assembly.  The LINQ to SQL model adapter has not been extensively tested with the WSP model, and though it will work, I suggest precompilation.
 
Hope this helps!
 
Brandon

 


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...BrandonHaynes.ModelAdapter.DotNetNukeDataContextBrandonHaynes.ModelAdapter.DotNetNukeDataContext


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.