0
I have a form where I have at View:
<div class="col-md-2 form-group">
@Html.LabelFor(x => x.CLIENTEDESDE)
@Html.TextBoxFor(x => x.CLIENTEDESDE, new { @class = "form-control", type = "date" })
@Html.ValidationMessageFor(x => x.CLIENTEDESDE)
</div>
I’m returning the data from a DataReader
and when I will make the edition of the registration, the same is not coming filled.
private List<TB_CLIENTE> TransformaReaderEmListaObjetos(SqlDataReader reader)
{
var retornando = new List<TB_CLIENTE>();
while (reader.Read())
{
TB_CLIENTE tabela = new TB_CLIENTE()
{
IDCLIENTE = reader["IDCLIENTE"] == DBNull.Value ? 0 : Convert.ToInt32(reader["IDCLIENTE"]),
NOME = reader["NOME"] == DBNull.Value ? string.Empty : reader["NOME"].ToString(),
APELIDO = reader["APELIDO"] == DBNull.Value ? string.Empty : reader["APELIDO"].ToString(),
CLIENTEDESDE = reader["CLIENTEDESDE"] == DBNull.Value ? DateTime.MinValue : Convert.ToDateTime(reader["CLIENTEDESDE"])
};
retornando.Add(tabela);
}
reader.Close();
return retornando;
}