What's wrong with my Update?

0

Good morning.

I'm a beginner and I'm having problems with my Update. I wonder what I'm doing wrong.

    public string Update(Usuario usuario)
    {
        var sql = new StringBuilder();

        sql.Append("UPDATE TBUSU SET " + Environment.NewLine);

        sql.Append($" SENHA     = '{usuario.Senha}' ");
        sql.Append($" ,EMAIL    = '{usuario.Email}' ");
        sql.Append($" ,TELEFONE = {usuario.Telefone} ");
        sql.Append($" ,STATUS   = '{(int)usuario.Status}' ");
        sql.Append($" ,FUNCAO   = '{(int)usuario.Funcao}' ");
        sql.Append("   WHERE    " + Environment.NewLine);
        sql.Append($"  NOME     = '{usuario.Nome}' ");


        var ret = Conexao.ExecutarComando(sql.ToString());

        return ret;
    }
    
asked by anonymous 05.12.2018 / 13:52

0 answers