Dear Wayne, I don't know if you have encountered this problem yet, but when you install RDCOM on a web server, you can have some security restrictions related to the webuser account permission to create RDCOM instances.
There is a little explanation of how to handle this, and some C# code of the principal classes used in the RNetWeb project, from the Leiden University Medical Center website, at this link: http://www.msbi.nl/dnn/Default.aspx?tabid=159 I hope that it can help in your works, Regards, Julien Vanwinsberghe -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de [EMAIL PROTECTED] Envoyé : jeudi 20 novembre 2008 11:21 À : rcom-l@mailman.csd.univie.ac.at Objet : RE: [Rcom-l] Building R(D)Com Web Application experiences Hi Thomas & fellow R(D)Com users, Thanks for the excellent suggestion of using RserverManager. This would seem to be exactly what I need! I have managed to get an example in VBA working (See VBA code at bottom of email). However, when I try to run a corresponding example using .NET with C# I run into difficulty. I can add a IStatConnector-objects to RserverManager with no problems but I can't seem to retrieve it back again! In VBA the RServerManager has a method called "Item" which I can pass in a string to retrieve my IStatConnector session! The methods, classes, constructors for the .NET example are quite different. Here is the C# code I used to set up an R session and store the IStatConnector called "RLink" into the RServermanager. Does anyone know how to get it back? i.e. can anyone translate the VBCode Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)") to C#? Regards Wayne '---------C# .NET example -------------- using StatConnectorCommonLib; using STATCONNECTORSRVLib; using RServerManager; protected void Button1_Click(object sender, EventArgs e) { int n = 150; StatConnector RLink = new StatConnector(); RLink.Init("R"); RLink.SetSymbol("n", n); Label1.Text = "here i go!"; ServerPool mservermanager = new ServerPool(); mservermanager.Add(RLink, "MyR"); } protected void Button2_Click(object sender, EventArgs e) { Need a method to get "MyR" back!!! } '------------- End C# Code ----------------- '---------VBA code example working correctly-------------- Sub RunRSession() Call StartRSession Call GetRSession End Sub '---------------------- '-------------------- Sub StartRSession() Dim RLink As StatConnector Dim mean As Double Dim n As Long Dim mservermanager As RServerManager.ServerPool n = 150 Set RLink = New StatConnector RLink.Init ("R") RLink.SetSymbol "n", n RLink.EvaluateNoReturn ("x <- 1:" & n) Set mservermanager = New RServerManager.ServerPool mservermanager.Add RLink, "MyR" 'Add Rlink StatConnector Session to RServermanager amd call it MyR. End Sub '-------------------- '-------------------- Sub GetRSession() ' Recall StatConnector R session from RServerManager Call RServerManager.ServerPool.Item("MyR").Server.EvaluateNoReturn("plot(x)") End Sub -------------------- End VBA Code -------------------------------------- -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Thomas Baier Sent: 19 November 2008 09:55 To: R (D)COM and RExcel server related issues Subject: Re: [Rcom-l] Building R(D)Com Web Application experiences Dear Wayne, [EMAIL PROTECTED] schrieb: > One method of doing this is to define a static StatConnector class in C# > see for example:_ __<http://www.daniweb.com/forums/thread49952.html>_ > but I certainly don't think this would be a recommended approach! > Alternatively I could store the instance of the StatConnectorClass to a > server side "Application Object" or "Session object" > see for example:_ <http://www.csharphelp.com/archives/archive207.html>_ > (I have yet to test this approach). > > Can anyone perhaps suggest another better approach? I have not tried to use this in the context of a ASP.NET application, but I would suggest to have a look at RServerManager. Using RServerManager, you can store IStatConnector-objects with a specific name in an object repository (RServerManager) and later retrieve the same objects by querying the object with its name. Basic documentation and an adminstrative console is included in the R/Scilab (D)COM server setup. Regards, Thomas _______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at _______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at __________ Information from ESET NOD32 Antivirus, version of virus signature database 3629 (20081121) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com _______________________________________________ Rcom-l mailing list Rcom-l@mailman.csd.univie.ac.at http://mailman.csd.univie.ac.at/mailman/listinfo/rcom-l More information (including a Wiki) at http://rcom.univie.ac.at