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...Getting StartedGetting StartedModule cretaed with christoc template using LinQ works OK in development, not in ProductionModule cretaed with christoc template using LinQ works OK in development, not in Production
Previous
 
Next
New Post
1/17/2011 11:28 AM
 
Hi all,

I've created a module that uses LinQ to get data from a DB in another server (not the same that my dnn website uses). I had no problem at all in my development pc. So I created and install file as usual, it installed OK in the production server and all seemed nice. But once I put the module I had an error showing me some "wrong references"

I was suspicious so I created a new simple module from scratch using christoc template again. Then I followed this steps:
- Configured the project as the christoc template suggests
- Edited View.ascx to have just a label and a button
- Added a new dbml object to my project
- Added a single table to the dbml to test it
- Created a .cs called ConnectionSQL with a simple method showData()

The code behind View.ascx only includes code for the button press:

protected void Button1_Click(object sender, EventArgs e)
{
   ConnectionSQL obj = new ConnectionSQL();
   Label1.Text = obj.showData();
}


The code in ConnectionSQL is quite straight foward too:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SVC.Modules.TestSQL
{
    public class ConnectionSQL
    {
        LinqDBDataContext dc = new LinqDBDataContext();
        
        public String muestra()
        {
            string s = "IT WORKS";
            return s;
        }
    }
}


As you can see that code doesn't even get data from the table. But the problem remained:
- In development the label shows "IT WORKS" when I press the button
- In production I get the error again.

The thing is, if I comment the line with LinqDBDataContext dc = new LinqDBDataContext(); everything works. For some reason I can't get to link that class so it works on another server.

Anyone can help? Thanks in advance
 
New Post
1/17/2011 1:34 PM
 
the Method in ConnectionSQL.cs is actually called "showData" and not "muestra" An error when translating my code to english :P
 
New Post
1/17/2011 10:14 PM
 
hev you checked that the production server has Linq installed?

Philip Beadle - Employee
 
New Post
1/21/2011 3:42 AM
 
Philip Beadle wrote:
hev you checked that the production server has Linq installed?

 I've been told it is. Any way to check if it's true? I'm not 100% about it

 
New Post
1/21/2011 6:28 AM
 
First thing to check is that your web.config on the production server is correct 

look for 

<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

and

<add namespace="System.Linq"/>
<add namespace="System.Xml.Linq"/>

If you are running the latest dnn 5.6.x installs then it should be in there by default - but well it never hurts to check.

Next make sure that when you moved the code over to the production server that you copied or installed the /app_code/ files and not just the /DesktopModules/ files.

If all is good and u still have problems - you may want to try making up a quickie module that just attempts to do a linq select and wrap it in a try wrapper - to report any errors.

One other area to check is that when u set up your linq database connection in your development tools, is that you set it to use the dnn connection string and not a local database connector - which may work by accident on your development box.

Westa
 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Getting StartedGetting StartedModule cretaed with christoc template using LinQ works OK in development, not in ProductionModule cretaed with christoc template using LinQ works OK in development, not in Production


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