Im developping windows phone 8.1 app with c#.
The question is how to connect windows azure sql server and get data from sql server?
In internet everywebsite say linqtosql. But in Windows Phone 8.1, there is no LinqtoSql classes.
I try entity framework search on internet but all website use again linqtosql datacontext.
Can anybody help me?
Windows phone 8.1 app is a client application that run on mobile. It cannot directly accesses windows azure database from your windows phone 8.1 client. you need to create some wcf service or web api on azure(or some other server) to get the data from azure sql. and in that service method or web api you can use LinqToSql to get data from Azure SQL. Below is the link on how you can create rest full web api on azure and add/retrive data form zaure sql
http://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-rest-service-aspnet-api-sql-database/
Hope this helps.
The quickest way is to use Mobile Services. There are some pretty good tutorials where you can use .Net or Javascript on the service side.
Getting started with Mobile Services
Related
I want to building an android app by Xamarin, C# language. This app can get or insert data to MySQL, this SQL hosted on another PC
So, Where I can get information and tutorial for this?
Thank you!
Basically if your MySQL database is in another computer, you need to communicate to it over web, I would suggest you use API, in computer with database make API Application.
https://learn.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-5.0
There is microsoft documentation for it.
Create endpoints for specific actions, and then communicate with them from your Xamarin App, here's the documentation: https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client
Create API service on computer with database
Communicate from your application to API (then API communicates with database, and sends back results to your Xamarin App)
I personally like RESTful principles for API's. documentation: https://restfulapi.net/
You should also consider adding authentication to API, so that only apps you want, can GET/INSERT data to your database
to get data from mysql in any app you need to API:
i using ASP webservice to get data from mysql
then in Xamarin.Android APP in refrence folder click right and add web refrence .
watch this video :
https://www.youtube.com/watch?v=XTZ8pbWAVW4&list=PLF8OvnCBlEY3qYheTm4gnaoWwBuBf2TUj&index=46
I am currently working on a windows universal app project(deskptop App), what i want to do is store data in my uwp app using sqlite database and be able to sync this data to a sql database located on azure, i went came across this online
https://blogs.msdn.microsoft.com/sync/2010/08/31/sql-server-to-sql-azure-synchronization-using-sync-framework-2-1/
but it seems applicable to sqlcompact and sql to sql on azure.
Please can any one help wiith how i can sync my uwp sqlite database with sql database on azure.Thank you
how i can sync my uwp sqlite database with sql database on azure.
You could use Azure app service. The mobile apps have the "Offline sync" feature:
You can sync dataset automatically with the back-end data, including conflict-resolution support.
For more details about "Offline sync" please reference this document.
For how to create a UWP mobile app please reference this article.
In your scenario, since you already have a SqlServer on azure, so when you are following the tutorial, after created the backend, in the step of Configure the server project, you can instead choose "Use an existing database".
After the client mobile app created successfully, then you need to Enable offline sync for your Windows app. The sample just showed how to use the SQLite as the local store. Using PushAsync method to push tables to the backend which is configured the SQL Server to meet your requirements.
I have a project assignment from the university and want to ask you if you can show me the right approach. I'm not asking for any code or to write me something. I just want some guidelines to follow.
Firstly, to explain a bit.. I have to design and implement an Info System in .NET. It should have a Desktop App (based on Windows Forms), a Mobile App (Windows Phone 7.1) and a database (MS SQL). The idea is to have a database, hosted on a remote machine. The desktop and mobile apps should be able to connect to that database and do some stuff with it (mobile app will be only for viewing data, not modifying). The system must be multi-client - the database should be able to be accessed from multiple desktop and mobile clients at a time.
I'm ready with the GUI and it's time to do some real work. What's the easiest way to get that communication done? I thought of a WCF Service Application, which will provide the clients' access to the DB. My idea is to have the database and the service on a machine with a public IP address. The apps (desktop and mobile) will connect to that machine and respectively to the SQL through the WCF.
I saw some tutorials around, but didn't find one that shows how to make that WCF Service work with both Windows Forms app and Windows Phone app. I'm not very familiar with WCF - should I have IIS to run the service? I'm also not sure what kind of techniques I have to use on the client side to do the connection...
Is this approach rght? Can this be done in the way I explained? What should I be aware of? I will appreciate every kind of advise and reproach.
The easiest (and in your case, most efficient) way would be to use Windows Azure. For the purpose of your project, you can always sign up for the free trial.
Specifically, you can leverage Windows Azure SQL Database. Or, if you are so inclined, you could use Mobile Services, which also relies on SQL databases but you will have a much better time setting it up in your Windows Phone app (doesn't matter whether you want to read or write data).
I'm developing Windows Phone application using Visual Studio 2010 using C# for database connection plan to use Windows Azure. Will you please say the steps? I have to call my web services into my app. How I access my REST web services in my Windows Phone ap? I need a C# coding for that too.
In my opinion the best approach now for this is using Windows Azure Mobile Services, please have a look at this tutorial which explains how to use it with Windows Phone 8
We have an application written in C# (.Net 2.0). MS-Access as database and crystal report for reporting. I have to port it to Windows Phone 7 (Target mobile is LUMIA 800).
My concerns are:
Does Crystal report work on windows phone 7?
Can I connect app to MS-Access in same way that I am connecting it on computer?
bad news, you have to start from scratch as WP7 only support SilverLight apps (XNA too, but it's for games). Moreover, you won't be able to connects to access directly.
A classic Data application on WP7 will use some Web Services hosted on a server that will provides all data access, whichever is behind. Then the WP7 will query the WS to get/put data.
I'd suggest you to take a look at WCF RIA Services, but you have to understand it's a high learning curve starting from Windows Forms skills.
Does Crystal report work on windows phone 7 ?
No, Crystal Reports are not supported on Windows Phone. Nor are they suitable for presentation on a mobile device.
Can I connect app to MS-Access in same way as I am connecting it on computer?
Microsoft Access isn't supported on Windows Phone. You can connect to remote databases, as described by Steve, but for local data storage, you would have to convert your data.
Also, the UI and the entire User Experience (UX) for a mobile application is vastly different than for a desktop application, and as such you would want to start from scratch regardless.