Can't read data from database
Xamarine
Moble appSelect from database id and name
Two fields
Error
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
My code
private async void LoadNotes()
{
MySqlConnection conn = new MySqlConnection(Constants.connectionString);
await conn.OpenAsync();
MySqlCommand cmd = new MySqlCommand(Constants.selectAllQuery, conn);
cmd.Connection = conn;
MySqlDataReader rdr = cmd.ExecuteReader();
if (rdr.HasRows)
{
while (rdr.Read())
{
notes.Add(rdr[0]);
notes.Add(rdr[1]);
}
rdr.Close();
lstNotes.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleExpandableListItem1, notes);
}
}