good day I'm trying to get the last record entered in a table, there are already several clients entered however in the execution when I try to give the value read to a variable shows me an error "There is no data available for the row or column "
try
{
OleDbConnection probar = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= C:\Users\user1\Desktop\base_datos_red.accdb; Persist Security Info=false");
probar.Open();
OleDbCommand c = new OleDbCommand("select max(clave) from clientes", probar);
OleDbDataReader a = c.ExecuteReader();
MessageBox.Show(a.GetString(0));
probar.Close();
}
catch (Exception ex)
{
MessageBox.Show(""+ex);
}