Get data from local xampp mysql-database - c#

Im am trying to connect a local mysql database which runs on xampp with a Universal Windows Platform (UWP) Application. I couldn't find any examples or tutorials on how to archieve this. In one article i have read that this isn't even possible and only sqlite is supported. Is this true?
I have to do a work for school and one criteria is, that it must have a relational database and another is to support multi-user functionality.
I dont know if it is not possible or am I just to blind to find Informations? Sometimes it seems really hard to get to informations to windows app development.
Did someone make experiences with connecting relational databases to UWP-Apps?

UWP app can connect to any server based database behind a web service. Per my experience, Windows Store app can directly connect to MySQL. Check this. I didn't have a chance to try it on win 10 UWP.
Sqlite is the database if you want to deploy a database to the device along with your UWP app.

Related

How to use a Database from a Windows tablet UWP app?

I will soon be deciding on a project for my university course and I had one in mind which is going to be a windows tablet application, using the UWP tools in Visual Studio, as I want to develop skills in C# and the Mobile area.
However I will need to have a database behind my application to submit and retrieve data from. Is this a relatively "simple" and common task to do? I'm not looking for easy, I just want something that I can accomplish though without worrying too much over the basics.
My original thought was to have a database on my PC and then host it for my tablet to connect too, but that would require constant internet connection and for my PC to be hosting. After having done a little bit of research I came across something called SQLite, which people seem to think is a good local database to put into the device.
Having no experience with mobile applications though, I was curious as to how I would develop an application on my PC, and then put it onto the Windows Tablet, both using the same database? Would I need to duplicate the database between systems? Or would I write the code up on my PC and then test it on my Tablet?
Again this is an area i'm still new to, database 'hosting' and mobile applications. Maybe i'm just over thinking things, but just by asking the question I can already tell I sound clueless. My experience has been with small WPF applications, Console Applications and Websites.
I will need to have a database behind my application to submit and retrieve data from. Is this a relatively "simple" and common task to do?
I think the answer is yes. As you mentioned, SQLite is a good local database for you to use. Since there are guidance, samples, teach videos for SQlite with UWP, it should be simple and common task for you to do.
I was curious as to how I would develop an application on my PC, and then put it onto the Windows Tablet,
For this you need to Get started with Windows apps. After you finished developing the app on the PC, you can publish to windows store or Sideload your app package, then you can install the app on your tablet from store or through side loaded package.
Would I need to duplicate the database between systems?
The SQlite database is actually a database file with .db or other suffix saved on the local device. Whether need duplicate depend on where you put the database file on. Since UWP app is sandbox and have limitations for access the folder on the device. By default, all apps can access the following two locations, Application install directory and Application data locations. If you put the database file on Application install directory, once you install the app on one device, the database will exist on the install directory and you don't need copy. But this directory is read only means that if your database don't need update and read only you can use. For another location,Application data location there are LocalFolder,RoamingFolder and TemporaryFolder. If you put the database on LocalFolder it cannot be roamed and you need to manually copy or user a cloud server helper you save it for roaming.If you put the database on RoamingFolder it can roam pay attention it has some restrictions. More details please reference File access permissions. In my option, SQLite is a local database, which is using only for local data will be better, I don't recommend you to use it for roaming. If you need a roaming data base, a database on cloud or server side will be much better.
Having no experience with mobile applications though, I was curious as to how I would develop an application on my PC, and then put it onto the Windows Tablet, both using the same database?
You should get start from this document Intro to the Universal Windows Platform. I believe you'r familiar with C# language, you can use C# to develop UWP apps.
As you mentioned, you could use sqlite as local database in your app. You could use LiveSDk's APIs to synchronous database when you switch from PC to tablet.
Here's a sqlite sample in uwp for your reference.
The OneDrive Photo Browser sample shows you how to get data from cloud, it would be helpful to you.

Data Sync between local database and online database

I am developing a C# based window store app which has GUI developed using WPF.
The application's database is already on the Cloud through Windows Azure, but, I also want to have local copy of it through SQLite
Now, my question is:
How can I synchronize the data between Windows Azure and SQLite?
You can use Windows Azure Offline Sync. This tutorial may help you which states:
Offline support will allow you to interact with a local database when
your app is in an offline scenario. Once your app is online with the
backend database, you sync your local changes using the offline
features.
this video may also help support the tutorial

getting data from database in windows 8 app

I am building a windows 8 app which requires me to get data from a remotely hosted server. Which API can I use to get the required data? I am using c# and xaml. I basically want to communicate with Microsoft SQL Server Analysis Services. ADOMD.NET cannot be used as windows 8 store apps donot support it.
In a Windows 8 app, we can specify for example a connection string to read out data stored in a server-side database. Not only would this be a huge security risk (imagine your connection string being on the thousands of devices where your app is downloaded!), it would also be pretty useless to have it there. WinRT has no knowledge of talking with a (remote) database. This means no ADO.NET or LINQ-To-SQL classes are in the API.
windows 8 style apps dont have out of the box functionality to contact to a database. so you need webservices to conect at a remote database.
If you have a database on a web server for which you can write an OData service, then that's an option. You can use the OData Libraries
I hope http://blogs.msdn.com/b/phaniraj/archive/2012/04/26/developing-windows-8-metro-style-applications-that-consume-odata.aspx will help you.

Windows Form App - Which database type should I use?

I'm hoping someone can help me. I recently started the development of a windows form application connecting to a remote sql server database. I was happy enough developing it until a potential client queried if they would be able to buy the whole application but they do not want the application connecting to the db via the internet.
I predominantly develop websites using php/mysql but migrated to c# for this particular project. I'm familiar with sql but not sure what database I should be using if the client wishes to have the whole application on their own computer. I've considered providing the database install as a pre-requisite when publishing the app (although I'm currently not sure how to do that) but I'm having reservations whether that is suitable or could lead to more problems. I want to create an application that can install to a single computer and has little to no need for administration. Could someone advise the best way to approach the data storage in this instance.
Because you have already a SqlServer database operating on your remote site, the best path should be to use the LocalDB version of SqlServer Express 2012. See this link about deployment.
If you don't use stored procedures, views and triggers then also the SQL CE could be an option, but you will not have file binary compatibility and you should work on importing your schema and data.
SQL CE is a compact light weight way of going..
http://blogs.msdn.com/b/sqlservercompact/archive/2011/01/12/microsoft-sql-server-compact-4-0-is-available-for-download.aspx

Windows Azure and Metro-style apps in Windows 8

I have atleast 5 billion ideas for a new App in Windows 8. However, most of them rely on a remote database connection.
Which is currently not possible in Metro apps. But I don't want just a work-around. Or an script that accesses an API which will access the DB and return results. So then I went to the MS forums and found a post somewhere (which I can't seem to find now) stating that I can just use Windows Azure SQL database and can connect to that one from within Windows Metro.
But I don't see any resources or documentation to back that up and I'm completely lost as to what to do.
Most apps these days, to offer any sort of personalized user experience need to communicate with the outside world and it's just impossible to do in Metro apps from what I can see.
Does anybody know if you can connect to a Windows Azure SQL DB from within a Metro style app? Any resources/Docs/Links/Samples you know of?
Thank you!
Metro apps are optimized for tablets and generally CPU-and-battery constrained devices. Directly connecting to a database and processing the results is expensive in CPU, battery AND bandwidth terms.
What's more, database protocols aren't cachable and were not meant to deal with internet latencies. Your app could waste a lot of time trying and retrying to connect to the database each time the connection quality degraded.
The best option would be to a set of WCF Data Services on top of your database and expose them to your application. It's easy to create a WCF Data Service on top of an Entity Framework model and the OData protocol used by WCF Data Services allows querying your entities using LINQ in an asynchronous manner. More complex processing can be done in the web server.
At this point Metro does not have a System.Data so there is no direct connect to the database. You would need to communicate with the database via WCF to a Web Service.
Metro does have a user settings facility but I cannot find it right now. http://msdn.microsoft.com/library/windows/apps/BR208189
The history is that the jumping off point for Metro was Silverlight. Not saying that makes sense just what I have read. It appears Microsoft wants to sandbox Metro for the Metro Store.

Categories

Resources