Click here to Skip to main content
16,005,162 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Somewhat better question Pin
Eddy Vluggen1-Aug-09 0:43
professionalEddy Vluggen1-Aug-09 0:43 
GeneralRe: Somewhat better question Pin
Luc Pattyn1-Aug-09 6:56
sitebuilderLuc Pattyn1-Aug-09 6:56 
GeneralRe: Somewhat better question Pin
supercat92-Aug-09 9:21
supercat92-Aug-09 9:21 
GeneralRe: Somewhat better question Pin
Eddy Vluggen3-Aug-09 21:19
professionalEddy Vluggen3-Aug-09 21:19 
QuestionWindows Service Pin
Rolando Y. Puno30-Jul-09 16:11
Rolando Y. Puno30-Jul-09 16:11 
AnswerRe: Windows Service Pin
N a v a n e e t h30-Jul-09 16:22
N a v a n e e t h30-Jul-09 16:22 
GeneralRe: Windows Service Pin
scottgp31-Jul-09 2:53
professionalscottgp31-Jul-09 2:53 
AnswerRe: Windows Service Pin
Pete O'Hanlon31-Jul-09 3:14
mvePete O'Hanlon31-Jul-09 3:14 
It is possible - you'll have to use remoting to do this, but it is possible. Basically, you'll need to define an interface that you will use on both sides:
public interface IUpdate
{
  void UpdateDatabase(DateTime from, DateTime to);
}
Then, you'll implement this interface in your windows service inside a class that derives from MarshallByRefObject. To activate this object from your web service, you use code that looks similar to:
TcpChannel clientChannel = new TcpChannel();
ChannelServices.RegisterChannel(clientChannel, false);
IUpdate upd = (IUpdate)Activator.GetObject(typeof(IUpdate), "tcp://myserver:1234/UpdateClass);
This example assumes that your server is called myserver, that it remotes on port 1234, and that the class that you connect to is called UpdateClass.

At this point, you can call
upd.UpdateDatabase(dateFrom, dateTo);
It's that simple.

"WPF has many lovers. It's a veritable porn star!" - Josh Smith

As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.


My blog | My articles | MoXAML PowerToys | Onyx



AnswerRe: Windows Service Pin
Arindam Sinha1-Aug-09 2:32
Arindam Sinha1-Aug-09 2:32 
Questionvb.net Pin
koushikraj30-Jul-09 3:27
koushikraj30-Jul-09 3:27 
QuestionRemoting or WCF? Migration Help Pin
cignox129-Jul-09 21:34
cignox129-Jul-09 21:34 
QuestionHow to Update and Retrieve records on server? Pin
NeilRanjan29-Jul-09 19:53
NeilRanjan29-Jul-09 19:53 
AnswerRe: How to Update and Retrieve records on server? Pin
Pete O'Hanlon29-Jul-09 21:38
mvePete O'Hanlon29-Jul-09 21:38 
QuestionSort grouped listview in Windows XP Pin
JarpoK29-Jul-09 1:33
JarpoK29-Jul-09 1:33 
QuestionLogging and Instrumentation Pin
Sandumone28-Jul-09 10:32
Sandumone28-Jul-09 10:32 
AnswerRe: Logging and Instrumentation Pin
Mike Ellison28-Jul-09 10:57
Mike Ellison28-Jul-09 10:57 
AnswerRe: Logging and Instrumentation Pin
martin_hughes28-Jul-09 10:59
martin_hughes28-Jul-09 10:59 
AnswerRe: Logging and Instrumentation Pin
Mike Ellison28-Jul-09 11:00
Mike Ellison28-Jul-09 11:00 
QuestionUpgrading a VB.net Windows application from Visual Studio 2003 to VS 2005 Pin
BryanMac78928-Jul-09 0:57
BryanMac78928-Jul-09 0:57 
AnswerRe: Upgrading a VB.net Windows application from Visual Studio 2003 to VS 2005 Pin
Luc Pattyn28-Jul-09 2:12
sitebuilderLuc Pattyn28-Jul-09 2:12 
GeneralRe: Upgrading a VB.net Windows application from Visual Studio 2003 to VS 2005 Pin
BryanMac78928-Jul-09 3:14
BryanMac78928-Jul-09 3:14 
Questionhello ,,,, i need help ,,,, please about MCTS 70-536 Microsoft PressBook Pin
H.Hemdan27-Jul-09 7:55
H.Hemdan27-Jul-09 7:55 
AnswerRe: hello ,,,, i need help ,,,, please about MCTS 70-536 Microsoft PressBook Pin
Abhijit Jana27-Jul-09 8:36
professionalAbhijit Jana27-Jul-09 8:36 
QuestionStrange Regasm related upgrade issue Pin
Russell Jones27-Jul-09 2:34
Russell Jones27-Jul-09 2:34 
AnswerRe: Strange Regasm related upgrade issue Pin
Dave Kreskowiak27-Jul-09 4:45
mveDave Kreskowiak27-Jul-09 4:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.