How do I return a value from a bank column sql
to textbox
in asp.net mvc
?
I created the textbox, I created a property inside a class.
<label>
@Html.DisplayNameFor(model => model.IRPJ) :
@Html.TextBox("txtIRPJ", Model.IRPJ , new {@class = "form-control form-control-custom", style="width:60px"})
</label>
How do I do this?
I have a class besides the model where I'm doing this:
public BoletoModel IRPJ(string Tipo)
{
StringBuilder qryIRPS = new StringBuilder();
qryIRPS.Append("Select Descricao1 ");
qryIRPS.Append("from TiposNfsApp where ");
qryIRPS.Append(" Tipo = '" + Tipo + "'");
DadosNfsApp objDados = new DadosNfsApp();
BoletoModel bm = new BoletoModel();
DataTable dt = new DataTable();
dt = objDados.RetornarDataSet(qryIRPS.ToString()).Tables[0];
bm.IRPJ = dt.Rows[0]["Descricao1"].ToString().Trim();
return bm;
}