How can I connect to a MySql database?

I'm developing an android app with Xamarin Studio however I cannot cannot to a MySql database using MySql.Data.dll
Does anybody know how I can do this?



  • JonathanPryorJonathanPryor USXamarin Team Xamurai

    Xamarin.Android does not include a MySql.Data.dll, so you would need to build it from source against the Xamarin.Android profile assemblies.

  • stiven.2124stiven.2124 USMember

    How can I use SQlite with xamarin such as JAVA and where it's the db storing?

  • SKallSKall USMember ✭✭✭✭

    Another option is to use ORM libraries such as SQLite.NET and ServiceStack.OrmLite. The benefit for ORM is that the code is reusable (OrmLite code can be used on other databases as well, such as SQL Server). Dapper might also work on mobile although I have not given it a try.

  • wallymwallym USInsider, Beta
    edited December 2013

    To talk to a mysql db, i would recommend building a web service that allows you to talk to your database over http. There are too many issues trying to talk over non port 80 over the internet. Return some json or xml from your web service and you should be good to go. I like WebAPI to do that.

    There is some provider that I read about back in 2010 that had been compiled to run within Xamarin.Android/iOS. It might be something you can use, but I would recommend against it.

  • wallymwallym USInsider, Beta

    To get at Sqlite on the device, there is a sqlite data provider that you can use. It is built into Xamarin's tools.

Sign In or Register to comment.