Set up MySQL back-end in Azure for Xamarin Offline Sync - c#

I have a MySQL database set up through the Azure Portal, currently hosted on ClearDB. I have created a mobile app using Xamarin Forms that implements an SQLite database which stores relevant information for my app in it. I am implementing offline sync functionality using the Microsoft.WindowsAzure.MobileServices.SQLiteStore library, and I am using functions such as:
await table.ToListAsync();
await table.UpdateAsync(entry);
await client.SyncContext.PushAsync();
await table.PullAsync("allEntry", table.CreateQuery());
The last thing I need to do is sync my local SQLite database with the Azure cloud MySQL database I have created. How do I implement this in C# (or Node.js .. or ANY language) such that my SQLite database can sync entries with my Azure MySQL database.
Thanks!

According to your requirement, I tried to create my Azure Mobile App project via Visual Studio, and install MySql.Data.Entity 6.9.9 which supports MySQL for EF6, then create my table controller working with my DBContext for MySQL.
I created my db model that inherits the EntityData which contains the table column type DateTimeOffset, but I encountered a incompatible error message. Then I found there is a known bug in MySQL Connector as follows:
An Entity Framework DbContext object created with a column of type DateTimeOffset returned an error indicating that DateTimeOffset values were incompatible with DateTime and Timestamp values. (Bug #24732001)
I found a release note about MySQL Connector/NET, then I tried to upgrade to MySql.Data.Entity 7.0.7-m61, but another problem about TypeLoadException - MySqlEFConfiguration encountered.
Since your goal is to use offline sync for your Xamarin app with azure mobile app, I recommend that you could try to use sql database or azure table storage for your data storage instead of MySQL, which could build your mobile app backend in a simple way. You could refer to here for getting started with it.

Related

Data Sync for Universal Windows App(desktop) Sqlite

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.

BotFramework ADO.Net Entity Data Model stopped working since project was published to Azure

I built a bot that I tested in my machine with the Bot Framework Channel Emulator.
But now I get an error accessing the ADO.NET Entity Data Model (which didn’t occur when I ran it in my local environment).
I can access the classes but I can't see to get data from the tables.
Publishing the project into Azure is not enough to ensure that the data is accessible?
You need to create a database in Azure. You cannot use a database in your App_Data folder. This article explains how to convert your database:
Implementing A SQL Server Database With The Microsoft Bot Framework

MySQL with Visual Studio: Authentication Method 'mysql_clear_password' Not Supported, How to Fix?

I have 2 MySQL servers I need to connect to using Visual Studio's Server Explorer -> Add Connection.
I'm setting the Data Provider to MySQL Database (MySQL Data Provider) and entering the credentials, then trying to retrieve the databases. Now, with one server it succeeds and with the second it throws:
"Authentication method 'mysql_clear_password' not supported by any of the available plugins."
As far as I understand there's something different between those servers' versions and plugins. The question is, is there a way to solve this on the client side?
I've tried setting the environment variable: LIBMYSQL_ENABLE_CLEARTEXT_PLUGIN=1 \ Y (docs) and upgrading all MySQL components.
The server is a MariaDB with PAM authentication plugin which means the problem is on the client side and supposed to be solved with 'MySQL for Visual Studio'. Currently (version 1.2.5), this does not work for users authenticating with PAM, so the fix was to create a local authenticating user.
However, I wouldn't recommend working with MariaDB and Entity Framework because although they say the MySQL Connector is compatible, it crashed for me during trying to create the model from DB.

How to access local sqlite database of android application from .NET application

I want to synchronize android app database with central sql server database.
I currently working on .NET web services,Web service should update remote android database after every 10 minutes.I am not getting exact way.how to do this? I have developed web service but getting error of unable to open database while accessing remote database.
Is it possible to update remote sqlite database from .NET webservices?
please help me.Is there any other solution?
You need to add the parameter Legacy Format=True to your connection string.
Take a look at https://www.connectionstrings.com/sqlite/ under "Using the pre 3.3x database format."

SignalR Hub with Windows Azure SQL Database

I've been a developer for a long time but I've never laid my hands on sql databases (I know, not smart of me). Anyway, I need to a create a databse on windows azure sql, design the tables and columns, and then access it using (Entity Framework , Entity Client, etc) from my ASP.NET Web Application.
I've followed this tutorial to create the database http://www.windowsazure.com/en-us/develop/net/how-to-guides/sql-database/ , I successfully created everything, just don't know how to connect to it now. Also, when I click on Manage on windows azure, I can see that the sql database (not the server) is prompting me to create a database ... inside my database which confused me a lot.
I've had a look at these, still not sure if that's what I'm looking for
http://msdn.microsoft.com/en-us/library/windowsazure/ff951633.aspx
All I need is a simply tutorial that would explain how do I connect to my database in order to design it (columns and tables), and then how do I access, read, write data from an ASP.NET Web Application
I'm using Visual Studio 2013 (I have 2012 installed as well), and can download whichever tool that would allow me to connect that dabatase.
Please help
The designer is not supported in Azure SQL..
You can instead us this link : https://SERVERNAMEGOESHERE.database.windows.net/
that contains an online database editor, or you could use a localdatabase first and then deploy through management studio
if you need your connectionstring later you can get this through windows azure portal --> your database --> Quick glance --> SHOW Connectionstring

Categories