I'm doing an application where I fill gridview
with a query SQL
, but when wanting to register more information in gridview
I get the following error:
You can not transform a DBNULL object into other types.
My code is as follows:
if (DialogResult.OK == miBskReten.ShowDialog())
{
codRet = miBskReten.sCodigo;
detRet = miBskReten.sDetalle;
idRtn = miBskReten.iIdRtn;
PrcRet = miBskReten.dPorcen;
this.ultraGrid1.ActiveRow.Cells["Codigo"].Value = codRet;
this.ultraGrid1.ActiveRow.Cells["Detalle"].Value = detRet;
this.ultraGrid1.ActiveRow.Cells["idRetencionIVARenta"].Value =Convert.ToString(idRtn);
this.ultraGrid1.ActiveRow.Cells["Porcentaje"].Value =Convert.ToString(PrcRet);
this.ultraGrid1.ActiveRow.Cells["Valor"].Value =Convert.ToString(PrcRet*dBase);
}
In this part of recording the information in the grid
I can not tell the grid to register a new data.