Link to home
Start Free TrialLog in
Avatar of eelou
eelou

asked on

Windows universal store app, what replaces system.data?

Have a c# project written in 2009, trying to bring into the windows store universal app (windows 8.1 VS 2013, c#).  The old project has references to Miscrosoft.sql.server.types (SurveySegments), and System.Data.  Was getting errors that led me to this link...https://social.msdn.microsoft.com/forums/windowsapps/en-us/eac6e48e-ff8a-46b4-9482-04cba37245be/systemdatadll-error.

This says "System.Data not found in windows store. you should do database proccess with WebServices in windows store".

Not really being an expert in all this,  I am not sure how to do this.  What exactly is this telling me.  Can I still use SqlServertype\surveysegments, or do I have to use something else?  How do I access this using Webservices, etc. Any examples of this out there?  Thanks.
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

As your citation says, System.Data is not available for Windows Store applications.

You need to create a Web Service that runs on the server. Typically, a Web Service is a bridge between an application and the computer on which it runs. The application calls the service through the web (whence the name), the service does its job and then returns the results to the application. In you case the job of the service would be to use System Data to perform the necessary operations on the database.

This overhead made us drop Windows Store when we started looking at it. The application we wanted to write was to be used internally only, and be available on tablets, which are easier to handle in a shop were a lot of dust makes things very bad for standard workstations. We ended up finding that the limitation of the input on the tablet as well as the extra work needed by writing 2 applications, the app itself and the service on the other end were not worth the trouble.

You will find how to connect to a Web Service here. An explanation of what a Web Service is, with sample code here.

Good luck.
Avatar of eelou
eelou

ASKER

I need to better understand this (I did not get much out of the sample code that you pointed me to).  I wonder if I am confusing web service with web server.   Are you saying that I need to connect to a web service on another system, or, that I am connecting to a web service on the same piece of hardware that is running the windows store app, and for some reason this has to go out to the internet (has to use the internet as the path back to my hardware)?  Is there another system that I must have some code residing on?

Is there a more recent sample\example that you can point me to that relates to the windows store and System.data?
A Web Service is an application that runs continually on your web server (such as an antivirus) and wait for calls coming through a web connection.

The Web service can be installed on any station that sees you SQL Server instance and is itself available to the Internet or intranet (if the thing is to be used internally), but it is most often installed on the same station as the SQL Server.

Your Windows Store application, wherever it is, calls a method on the Web Service. The Web Service can use System.Data and can thus communicate with you SQL Server instance and retrieves the necessary information, then returns it to your Windows Store application where you can use it.

The whole mechanism and code to make it work is too much to give here, so that is why I sent you to pages that tried to explain it in more details. There are numerous references if you search Bing for web service for windows store.

Be aware that developing Windows Store applications is completely different from what you might be used to. You have a limited version of the framework, no System.Data, no Windows.Forms. That is why things looks complex at the start. You have to learn a completely different way of programming. This is not something that you will be able to grasp by reading only one or two web pages.
Avatar of eelou

ASKER

I would prefer to stay away from a web service (having to go out to the internet).  Will SQLite (or other), have  SurveySegments ?  It is not that I have a thing for System.data, rather than I want to do Metes and Bounds?  
Without creating a web service, what SQL (or other product, do not want to have to use the internet, want something that can be included in the C# project), can I use to enter in metes and bounds, calculate acreage, draw the plan.
You do not have to use the Internet for a web service. It can run on the company Intranet. The word "web" in web service means simply that you use an http connection instead of a standard network connection.

No matter what database you put in the background, you need classes to access it, and Microsoft did not see fit to add database access classes in Windows Store. Windows Store was not developed for enterprise development, it was created for mobile development, and mobile equipment usually does not have a network connection.

In understand your frustration, I suffered the same thing. I had great ideas for Windows Store in a woodworking shop environment, but turned them down when I saw that Windows Store was really not a solution for internal applications. I ended up running a standard Windows desktop application on a tablet that has the full Windows 8.
Avatar of eelou

ASKER

I am an individual, not a company.  I do not have an intranet, nor do I want to put something on a server someplace.  I wanted the application to be self containing (not to have to go anywhere else for anything)...this does not appear possible (for what I want to do), for a Windows Store app.  If I understand what you are saying, no mater if I switch from SQLServer to SQLite, MySQL, whatever, there is no access to the database.  I looked at Bing maps, Google Maps, etc, but they do not seem to have the capabilities that I am looking for (to be able to enter metes and bounds and draw a plan from them.  SQLite has a win-rt module, that gives me the impression that everything can be included in the code, but does not appear to have what I am looking for .
First of all, rereading all of that, I see something missing. A service does not have to be on the web or the intranet. It can run locally on the station, the same as you anti-virus is running as a service. I use the term web service because it is what is seen most often, but any service is OK. So, it could run locally. This is how many programmers test their Windows RT applications and the service they develop in parallel. So I cannot think of anything that can prevent you from installing the service on you users station, except the pains of maintaining so many different components synchronized and up to date. There is no way, at least no easy way that I know of, to have a central point were the users can install and update all these different elements.

You cannot distribute a Windows RT application along the service, the database application/server and the database, because Windows Store applications need to be distributed through the Windows Store, whence their name. And Windows Store does not offer the possibility of installing SQL Server Express locally along with the application. This is not really a limitation of the Windows Store, it is because most tablets and many PCs sold with Windows 8 do not have the full version of Windows. They sell them as Windows 8 machines, but they have only Windows RT installed, and Windows RT is not Windows 8.

Because it was intended primarily for tablets, with the vague idea that you can have the same interface on both a tablet and a desktop, Windows RT was designed from the ground up to work with external data. I have never worked with SQLite, but a quick look at sqlite-winrt seems to indicate that this is only an API to connect to a database. The database thus has to be somewhere, and for Windows RT that somewhere is a service.

Gee Whiz! Even System.IO is not there. If you want to read and write local files with Windows RT, you are limited to one class, FileIO, that is very limited in scope compared to what System.IO offered. Hey, you cannot even read in My Documents unless they changed things with Windows 8.1, which came out after I dropped out of the Windows Store application bandwagon.

So, if you really want to go Windows RT, you are very limited on local storage, and must usually go to a server to use a database. Or install locally with the installation and maintenance pains I mentioned sooner, hoping that your users all have a full version of Window 8.

Or do as most programmers I know do, stick to Windows desktop.

Anyway, from what has been announced, Windows RT is already dead, and even Microsoft somehow confirms this. So few people really use it for real work, and so many people would be stuck with a useless computer if Microsoft was to drop it completely, that it will be integrated into Windows 10. The desktop resurfaces as the main interface, with Windows RT as an add-on to the Start menu for those who absolutely need it for their little games and apps that are very nice to look at, but really do not do much.

And about your reticence to put something on a server someplace, that I completely share with you, as a user as well as a programmer (unless the server is mine). Your would be willing to connect to Bing or Google to get information? These are "servers someplace" you know?

No matter what you may prefer, there is no way that you can skip the "server someplace". This is the way computing is going. This is the way the new generation, and more and more of the old generation is going. This is the way the modern world (Google, Facebook, Twitter and all of their little friends) is going. This is the way and the only way that new operating systems such as Android work. And Windows RT is one of these new operating systems. Office as gone there. Most of the new stuff in Visual Studio was about that. Even Visual Studio itself as followed Office in that direction.

I personally did not believe it would happen, but it did. I personally prefer to keep my stuff as close to me as possible and to be as independent of others as I can.

But there is no way you can skip the server somewhere it if you still have at least a few years left in your life as a programmer.
Avatar of eelou

ASKER

I appreciate the information.  If Win-Rt is dead, perhaps I should not put any more effort into it, and instead wait for Windows 10.  Perhaps join the Windows Insider Program.  I wonder if the data and IO support will be any better.
One question that was not asked. Why do you need to use Windows RT, since so few real applications have been written for it? What are the problems with your 2009 project that bring you to change the platform?

Windows 10 is Windows 7, evolved into Window 8, evolved into a mix of Windows 8 and Windows RT.

The data an IO support you will get there is the same you had in previous versions of Windows.
Avatar of eelou

ASKER

I wanted to upgrade the project to make it portable for the latest hardware (tablets and phone), and, learn the technology to make myself more marketable.  There was an article today, that said that tablet sales are slower because of the larger phones.  So, whether the individual was carrying a tablet or a phone, they could use the product (without having to connect to anything, anywhere else). So, if what you say is true..."The data and IO support you will get there (win 10), is the same you had in previous versions of Windows.", Windows 10 is the way to go.  Going to also have to get VS 2015 for windows 10 development. And then (future plans), will need to do it for IOS and Android (else someone else will).
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada 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