lundi 29 juin 2015

SQL Requests against local SQL database with android simulator

This is kind of a weird question, so I'm open to suggestions.

I'm working on an Android app (using Xamarin, although I don't think that's relevant here other than to tell you that it's in c#). I would like to make some sql queries from the Android app to get and update some information on a sql server. I think I've figured out how to do this properly - unless there is some special case for android, I mainly followed this tutorial: http://ift.tt/1R0aEE0

Assuming that works, my issue has to do with testing it. I'm running the application on the android simulator, and the sql database is running locally. However, it appears that the simulator is not able to talk to the local database (which would make sense) since I'm getting:

System.Data.SqlClient.SqlException: Server does not exist or connection refused. ---> Mono.Data.Tds.Protocol.TdsInternalException: Server does not exist or connection refused. ---> System.Net.Sockets.SocketException: Could not resolve host 'HOST'

So, my question is: is there a way for me to test my android application's sql functionality using a local sql database and the android simulator? If not, what's the simplest way I could test this functionality?

Aucun commentaire:

Enregistrer un commentaire