Lightswitch: Stop Windows Service -



Lightswitch: Stop Windows Service -

i have little desktop application built in lightswitch allows remote sales staff log , work client info locally on laptops client sites don't have internet/vpn access. such, each client application has local install of sql 2012 express.

in command bar, have button labeled, "database backup" meant re-create .mdf file machine mapped network drive when office. works fine on test .mdf file isn't attached sql instance. problem when trying re-create .mdf file in production (with sql running), can't re-create since it's open in sql express.

my question this: there reference can add together client allow me utilize system.serviceprocess.servicecontroller class? or best assembly utilize stop restart windows service? (stop service => re-create mdf file => restart service)

first, want ensure understand topology. i'm assuming app configured silverlight desktop app deployed 2-tier environment app , database hosted on same machine.

with beingness case, should able write code app can phone call servicecontroller class. can't "client" code since silverlight , doesn't have access servicecontroller. instead, you'll need write in "server" code runs host process on same machine , has access total .net framework. can expose custom server code through web api client code can invoke when user clicks button. here's article explaining pattern: http://blog.pragmaswitch.com/?p=765.

visual-studio-lightswitch lightswitch-2012

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -