C# Xamarin platform Andoid et connection Mysql
Bonjour,
J'essaie de réaliser une appli commune à Android et Windows. Sur l'appli windows aucun problème pour le connecter à ma base MySQL mais sur androïde, j'ai une exception que je ne comprends pas.
Message exception:
The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception.
-------------------------
Message inter-exception:
The type initializer for 'MySql.Data.MySqlClient.MySqlConfiguration' threw an exception.
-------------------------
Message inter-exception:
Could not resolve type with token 01000037
Cela fait un moment que je cherche mais rien ne fonctionne.
> Autorisation androïde
> encodage west
> méthode de gestion HttpClient
J'en suis réduit à avoir créer une application vide qui ce connecte à la base mysql dans le constructeur.
Voici le code si quelqu'un à une idée.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
new I18N.West.CP1250();
string connsqlstring = "Server=xxxxx;Pooling=false;database=xxxx;User ID=xxxx;Password=xxxxxx;charset=utf8";
sqlconn = new MySqlConnection(connsqlstring);
sqlconn.Open();
string queryString = "select * from xxxxxxxx;";
MySqlCommand sqlcmd = new MySqlCommand(queryString, sqlconn);
string result = sqlcmd.ExecuteScalar().ToString();
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.SetTitle("MySql result");
alert.SetMessage(result);
Dialog dialog = alert.Create();
dialog.Show();
sqlconn.Close(); |