Link to home
Start Free TrialLog in
Avatar of BROOKLYN1950
BROOKLYN1950Flag for United States of America

asked on

SQL access from a Windows 10 Universal Application

I'm trying to make an application for my company which will run on Windows 10 tablets connected to a main server over the internet via a VPN. I have the VPN and devices established and am trying a sort of "Hello World" with a tablet.

Here is my problem: My app will require access to the SQL Server running on main server hosting the VPN.

The SQL Server is already configured to allow access over the network and has been tested. If I write a simple WPF application, I can run it from the tablet and the SQL connection works perfectly.

So why is it a problem?

Because for the life of me I can't figure out how to connect to an SQL database from a Windows Universal Application. I'm using Visual Studio 2015 and the "Blank App (Universal Windows)" solution template. The System.Data.SqlClient namespace is not available by default, no framework assemblies are listed when I try to add a reference, and when I browse to the System.Data.dll to add it manually, I get other errors.

The above makes me feel like I'm going about this wrong; database access is a basic need for an application and shouldn't be this hard to implement. Can anyone tell me how to go about it?
ASKER CERTIFIED SOLUTION
Avatar of Pavel Celba
Pavel Celba
Flag of Czechia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of BROOKLYN1950

ASKER

Is there really no way to access the database directly? I feel like there has to be some way since I can do it from a WPF application. A service layer sounds like a lot of extra work for such a simple need. I'm not going to be making a web app, in fact I'm actually doing this to switch from a web app to a tablet app.
Simpler way is the web application in this case. If you write web app for the tablet then users don't recognize the difference.

Windows Universal applications were introduced to be multiplatform for various processors and various display sizes thus to use Service layer is the only way today.

Of course, you could write your own SQL Client which is much more complex than to learn Service layer.
I ended up going with a WPF application as opposed to a Universal App, but this is still the correct answer for anyone who doesn't have that option.