public void BorrarAdmin(string id)
{
SqlConnection c = null;
string comando = "DELETE FROM [Admin] WHERE dni= '" + id + "'";
try
{
c = new SqlConnection(conexionTBD);
c.Open();
SqlCommand cmd = new SqlCommand(comando, c);
cmd.ExecuteNonQuery();
}
catch (SqlException)
{
throw ;
}
finally
{
if (c != null) c.Close(); // Se asegura de cerrar la conexión.
}
}