Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

675
Views
MySqlConnector MySqlConnection.OpenAsync() not working

I am working on a Xamarin.Forms Android app, which needs to connect to a MySQL database.

I decided to use MySqlConnector, because it has async methods.

However, when I call OpenAsync() it throws System.IndexOutOfRangeException.

Open() works fine, but I would like to use async. Am I doing something wrong?

Here is my code:

private static MySqlConnection DBConnection;

internal static async Task<bool> SetAndTestConnectionString(string dbendpoint, int userid, string password)
{
    DBConnection = new MySqlConnection($" *connection string* ");
    bool connectresult= false;
    try
    {
        await DBConnection.OpenAsync();
        connectresult= true;
    }
    catch (Exception e)
    {
        connectresult= false;
        Console.WriteLine(e.Message);
    }
            
    return connectresult;
}
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!