1
public int ObterTotalAcessos()
{
int obtertotal = 0;
using (var connection = ServiceLocator.ObterConexao())
{
var command = connection.CreateCommand();
command.CommandText = "SELECT SUM (ACESSOS) FROM USUARIO";
command.Parameters.AddWithValue("total", obtertotal);
var reader = command.ExecuteReader();
if (reader.Read())
{
// o erro está aqui v
obtertotal = reader.GetInt32(0);
}
}
return obtertotal;
}
So guys, my problem is occurring inside (if). Displays error: Specified conversion invalidates. Someone knows what they pose to be?
What is the error message?
– Renan
Specified conversion is not valid. Error happens inside in IF
– user2254936
I see that you are not a new user, so please read this page: [Ask] to improve the quality of your questions!
– Marciano.Andrade