This is the code, in SQL the columns ID_C
and CALLE
are int
type, I am writing a C# app for add registry and the error is in the save button, in the int type textbox.
Someone help me!!
private void btnGuardar_Click(object sender, EventArgs e)
{
Cliente Cliente = new Cliente();
Cliente.ID_C = txtID.Text= Cliente.ID_C.ToString();
Cliente.NOMBRES = txtNombres.Text;
Cliente.CONTACTO = txtCorreo.Text;
Cliente.CALLE = txtCalle.Text;
Cliente.NUMERO = txtNumero.Text= Cliente.NUMERO.ToString();
Cliente.COLONIA = txtColonia.Text;
Cliente.FECHA_ALTA = txtFecha.Text;
int resultado = ClienteDAL.Agregar(Cliente);
if (resultado > 0)
{
MessageBox.Show("Datos guardados con exito", "Datos Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("No se grabaron los datos", "Error al guardar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void btnCerrar_Click(object sender, EventArgs e)
{
this.Close();
}
}