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...DNN Platform (o...DNN Platform (o...Call .Net from a CLR Stored Procedure?Call .Net from a CLR Stored Procedure?
Previous
 
Next
New Post
7/8/2012 1:06 PM
 

Hi,

Is it possible to call the DNN API from a SQL server CLR stored procedure.

I've tried to install the dotnetnuke API in the database as follows:
CREATE ASSEMBLY DotNetNukeAPI
FROM 'I:\Inhouse\DotNet\Framework4_0\Components\DotNetNukeDevDB\DotNetNukeDev\bin\Debug\DotNetNuke.dll'
WITH PERMISSION_SET = SAFE;

Which gives the following error, stating that the system.web dll needs installing:
Assembly 'DotNetNuke' references assembly 'system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(failed to retrieve text for this error. Reason: 15105)). Please load the referenced assembly into the current database and retry your request.

When I install the system.web dll it says the system.drawing.dll needs installing and so on.

Is there an easier way to make reference the DNN API? Or any better way to call .net from a stored procedure?

The reason I'm trying to make a call to the DNN API is that I'm using a 3rd party module which can call stored procedures, my only option is to make my call from there.

Would be very grateful for any suggestions, ideas, etc.

Steve.

 

 
New Post
7/9/2012 4:03 PM
Accepted Answer 
in theory it is, but you would have to include a lot of dependant assemblies (as you've seen), and in addition many parts will not work as they will expect a HTTP Context (which will not be there). It's a slightly odd request, but in this case I think you would be better off setting the sql clr sproc to allow external access and call a webservice - this webservice would be hosted within a dotnetnuke install (e.g. using the services framework) and would then allow easy API access (with http context) and could return data - http://stackoverflow.com/questions/46... and http://www.codeproject.com/Articles/8... covers how to do this for an asp.net application

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/15/2012 9:47 AM
 

Thankyou Cathal, using a web service is a good idea, I think I can achieve what I need to do.

It's not my ideal architecture, but it's probably the best solution for the 3rd party module that I'm using.

 

Steve

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Call .Net from a CLR Stored Procedure?Call .Net from a CLR Stored Procedure?


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