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 ExtensionsModulesModulesDataProvider ErrorDataProvider Error
Previous
 
Next
New Post
1/15/2010 11:21 AM
 

I am building a module ('MyModule') in which a user can set a few parameters for a calculation job.
The calculation job is then saved to a table in the DotNetNuke database.
A windows service on my machine ('MyService') checks this table every couple of minutes and if there are any jobs to be calculated, calculates them.

In my solution file there is one project that is MyModule. In another project file (in the same solution) the windows service is implemented.
MyModule has it's own namespace. The same goes for MyService. I've got a reference from MyService to MyModule.

A JobController.vb and a JobInfo.vb class are implemented in MyModule. But I need those in MyService too. I can initialize the JobController in MyService.
Only when I try to call a method ('GetNonCalculatedJobs') it returns the following error message: "The type initializer for 'MyCompany.MyModule.DataProvider' threw an exception." (The same method works fine when it resides in MyModule.)

I don't have a clue what causes this error message. Any help is greatly appreciated!


The complete error message is:
----------------------------------------------------------------------------------
System.TypeInitializationException was unhandled by user code
  Message="The type initializer for 'MyCompany.MyModule.DataProvider' threw an exception."
  Source="MyCompany.MyModule"
  TypeName="MyCompany.MyModule.DataProvider"
  StackTrace:
       at MyCompany.MyModule.DataProvider.Instance()
       at MyCompany.MyModule.JobController.GetNonCalculatedJobs() in D:\DotNetNuke\DesktopModules\MyModule\Components\JobController.vb:line 107
       at MyService.MyService.JobTimer_Elapsed(Object sender, ElapsedEventArgs e) in D:\DotNetNuke\DesktopModules\MyService\MyService.vb:line 34
       at System.Timers.Timer.MyTimerCallback(Object state)
  InnerException: System.NullReferenceException
       Message="Object reference not set to an instance of an object."
       Source="DotNetNuke"
       StackTrace:
            at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache)
            at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectNamespace, String ObjectAssemblyName)
            at MyCompany.MyModule.DataProvider.CreateProvider() in D:\DotNetNuke\DesktopModules\MyModule\Components\DataProvider.vb:line 49
            at MyCompany.MyModule.DataProvider..cctor() in D:\DotNetNuke\DesktopModules\MyModule\Components\DataProvider.vb:line 44
       InnerException:
----------------------------------------------------------------------------------

 
New Post
1/18/2010 8:30 AM
 

My question put simpler:

how can I use the DotNetNuke (SQL)Dataprovider in another project?

 
New Post
1/18/2010 10:08 AM
 

Hi Gvdamn,

I responded to your post in the Providers forum.

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDataProvider ErrorDataProvider Error


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