how to save the result of a query in a variable

0

I'm debugging this code

SqlCommand cmd2 = new SqlCommand("SELECT LOCT_LOGIN_EMAIL from LOCT_LOGIN_V Where LOCT_LOGIN_USUARIO=@usuario", cnsec);
           cmd2.Parameters.AddWithValue("@usuario", usuario);

I would like to save a variable with the result

I use this

correo = cmd2.ExecuteScalar().ToString();

but it does not work

help "/

    
asked by Emanuelle Garcia 31.05.2018 в 00:28
source

0 answers