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...Using Modules a...Using Modules a...SchedulerClient access to DB and FIlesSchedulerClient access to DB and FIles
Previous
 
Next
New Post
7/3/2010 12:35 PM
 
I have a requirement to process uploaded files in a DotNetNuke 5.4 site and add rows to tables in the database. I need this to run on a hosted site that supports ASP.NET V3.5

To acomplish this, I have started by creating a simple instance of a SchedulerClient in CSharp and have successfully deployed it by copying the DLL into the DotNetNuke/bin directory and then configuring the Host | Schedule to run it periodically. I followed the only information I could find on build a SchedulerClient at http://dotnetslackers.com/Community/b... Is this the best way of building a ScheduledClient?

Now I want to add more functionality to my scheduler, to read the contents of files uploaded in the DotNetNuke site and then add rows to tables defined in the site's DB connections. I have two questions

1) How can I determine the directory to read the files from? The files are uploaded to the location relative to the root of the DotNetNuke site. As this is a hosted site, I do not know the absolute path of the directory. Is there some way of geting the root directory of a DotNetNuke instance?

2) I have configured LINQ to create access to the tables, all that remains is to get the LINQ to use the connection string defined in the web.config file of DotNetNuke. I cannot determine how to do that when the project is installed as a standalone class library. If it was a DotNetNuke visual module, I could use global::System.Configuration.ConfigurationManager.ConnectionStrings["SiteSqlServer"].ConnectionString.

Thanks
Wayne
 
New Post
7/4/2010 11:37 AM
 
I have resolved the second issue.  I found that the issue was I was using an ASP.NET 3.5 which meant that I needed to use System.Configuration.ConfigurationSettings.AppSettings["SiteSqlServer"] to get to the connection string for the DB.

I have added a new appsetting to the web.config file that specifies the directory path for the DotNetNuke instance as a workaround.  I did not find a programmatic way of determining where DotNetNuke was installed at runtime, but this works.
 
New Post
7/4/2010 6:34 PM
 
Each portal has its own root directory, you need to load portal settings per site to get the data, due to the out of process character of scheduler jobs, this is not necessarily provided. However, be aware that DNN scheduler will run only if the site is active, any IIS stop or recycle of the app pool may interfere.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...SchedulerClient access to DB and FIlesSchedulerClient access to DB and FIles


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