Xamarin and SQL Server - sql-server

We are just about to start developing an iOS and Android app with Xamarin.
The app will include a user log in and saving/getting data from our SQL Server database.
There seem to be some different approaches, which way is best to connect securely to our database through the app?

The best approach is to wrap your SQL calls in a web service then you can invoke them in your Xamarin application. Here is a guide http://developer.xamarin.com/guides/cross-platform/Application_Fundamentals/Web_Services/

Related

How do I make this web service call fault tolerant?

We have a WinForms desktop app that connects to a remote server to pull some data. The remote server hosts a web service on a standard IIS website that queries a SQL Server database installed on the same machine. Today, if the remote server is under maintenance or not available our end-user cannot retrieve the necessary data.
Now I am requested to make this feature fault-tolerant. Here are my questions:
Should I ask for another remote server that runs the same web service and move the DB to a third remote server? So the two web services can connect to the same DB?
Should I consider moving the web service logic to the WinForms desktop app and connect directly to a remote DB paying a first-class 99.99% availability service?
Do AWS or Azure provide a ready-to-use solution that fulfills my requirements?
Is there any other option I didn't consider?

How can I connect my SQL Server database that is placed on another server using API or Web Service in MVC to website that is on a different server

I uploaded my website to GoDaddy web hosting and the database is placed on another server.
I want to create an API - either REST or SOAP - to connect my web site with my SQL Server database.
I need help - how can I create an API in ASP.NET MVC 5 so that I can connect my database with my web site? Kindly provide me with a link or code so that I can solve my issue.
I have never worked on API before - any help will be much appreciated.
ASP.NET MVC is now old school. Try ASP.NET Core.
You need to design and develop an N-Layered application: Data, Service and UI.
It doesn't matter where the database server is sitting, as long as your WebAPI can connect to it.
I suggest you build a restful web api with asp.net core :
https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.1&tabs=visual-studio
Put your db connection string in the app settings file.
Although you use other database server, it doesn't matter. You just need to make sure you check your connection string and point it to your database server. For publishing method, it is same, you can use FTP or Visual Studio
Please open your project with Visual Studio tool
On the Solution Explorer windows (which is normally located on the top right hand corner of the VS tool), right click your project and select Publish
Please kindly publish it to a local folder, such as C:\Project
Please just upload whatever files/folders you see on C:\Project to your server via FTP
If you have any problems, you can contact your support team
You can get the Reference from
Sample_WebAPI_Project ,
instead of Using List created you can create Database Connection and get data from Database

How to migrate EF + SQL Server to EF + WebServices + SQL Server to create a secure solution?

We currently have a WinForms application that accesses our SQL Server database through Entity Framework. The solution was built with database-first methods. Our database is hosted in Microsoft's Azure SQL services.
We need to secure the application connection to the database but the application will reside on employee laptops that need to work from anywhere. Currently the firewall is open to any IP because obviously the IP address for employees change depending on where they are located.
We need to introduce a web services layer but I don't want to run an entire website just to provide a web service to authenticate against. Creating an entire MVVC between the database and a web service, configuring packages, authentication, etc. just seems a bit much just to wrap the EF / DB communication with AD authentication.
How can we add a web service layer that is seamless for Entity Framework that will allow for Azure AD authentication? Is there an Azure service that works with EF to provide SQL Server access with better authentication? What options are out there that we don't know about?
Update: Adding a little to narrow down the question...
Is there a solution or Azure service that can provide a secure web service layer between EF (easily) and our SQL database? For example, does EF work with Azure Web Apps or Azure Mobile Apps without needing separate models for the web services layer?
Thanks in advance for any help.
You can use token-based authentication as explained here and here.
A file-based authentication is also available as explained here.

SQL connection in UWP app

I have am existing project that runs on windows, mac, ios and android. I'm looking for a way to make a windows phone version, but I can't figure out how to use SQL. My current code base is very large and I can't "switch" to using EF. How can I get access to databases in UWP?
If you want to connect a local database, for example the SQLite, there are implemented libraries could be used do this stuff:
A Developer's Guide to Windows 10: (10) SQLite Local Database
If you want to connect a server-based database, for example, the SQL Server database, unfortunately, there is not a built-in API like ADO.NET that could be used to connect the SQL Server directly. And for a workaround, you would have to utilize a middle layer for example, the WCF Serrvie:
How to access data from SQL Server database in Windows Store app, although this sample is written for store app, the used approach is the same for UWP application.
You'll not be able to connect directly to a Microsoft SQL Server database. Instead you'll need to make some type of Service layer that communicates with the database and your phone app would need to communicate with that. For more information on how to do that see the code same and the video that Microsoft has hosted here:
https://code.msdn.microsoft.com/windowsapps/How-to-access-data-from-5f2602ec

Sync Mobile Database to Backend Database

I have created Application for Windows Mobile application 6 and used mobile sql database.Now I want to sync the data in mobile db to backend database(MS SQL).So please tell me how to sync the data in mobile db to backend using Microsoft Synchronization Framework
Do any of these help with what you are trying to do?
Any Good Examples of Mobile Sync Framework Solutions
Microsoft Sync Framework. sdf file not syncing with server
Synchronise sql server data between mobile device and laptop
Compressed CAB files cannot be installed by WCELOAD

Resources