Sat Feb 18, 2017 12:56 am
Hello
Nothing like digging up old posts.
Regarding the Op's 12 month old question perhaps we should be asking is whether connecting to a remote SQL Server is the right way to commit data to a database. SQL Server is a server type application and usually lives in the datacenter. Win IoT is not a datacenter application and does not live in the datacenter. For reasons I won't elaborate on SQL Server should never be exposed to a client outside the datacenter - this applies as much to desktop applications as much as this scenario.
We need a way to bridge the SQL Server to client application and that's where web services step in. Windows Universal Applications (which we use on both Win IoT and any Windows Store device) has great support for web services. While you can use an Azure solution WCF will do fine in a home lab. There are several ways to host WCF web services including IIS, Windows Services, Windows Activation Services, or any .Net application running the server profile.
The question about whether to run the web services under WCF in your own "datacenter" vs Azure probably comes down to whether or not you have a proper datacenter and whether you want to provide the service commercially or for your own consumption. I cannot comment on how hard it is to migrate services from WCF to Azure and vice versa; but, for something simple it should not be to hard.
Given the Op is already running SQL Server hosting a WCF service should not be a problem.
Assuming you are developing using Visual Studio the ease of setting up WCF services is going to depend on what templates you have available; but, hopefully you have a "WCF Service Library" or "WCF Service Application". Once you have created and deployed the services you can "add service reference" to your Win 10 IoT project and put in the URL you deployed the services to. This will generate a bunch of classes to allow you to call functions against the host. Setting up a DataContract that supports the sensor data and a couple of OperationContracts for data access should not be to hard.
If you don't have the VS templates for WCF you can still do it; but, you will have to do more work yourself.