Insert problem using Visual Studio 2013

-2

As you can see in the image, it tells me that I send null in dpi

but I have filled these fields correctly in the form

Some solution about it

In the third image I can see the full picture as I've handled it

Insert code

Private Sub GuardarToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GuardarToolStripMenuItem.Click

    ''1 ---------creamos linea vacia 
    Me.registro = dtparticipantes.NewparticipantesRow
    ''obtener datos del formulario y asignarlos a registro columna

    ''2 ---------asignamos datos a linea
    Me.registro.dpi = Integer.Parse(txtdpi.Text)
    Me.registro.nombres = txtnombres.Text
    Me.registro.apellidos = txtapellidos.Text
    Me.registro.edad = Integer.Parse(txtedad.Text)
    Me.registro.sexo = txtsexo.Text
    Me.registro.federacion = Integer.Parse(txtfederacion.Text)
    ''Me.registro.equipo = Integer.Parse(txtequipo.Text)

    ''3 ---------agregar registro al dataTable
    dtparticipantes.AddparticipantesRow(Me.registro)

    ''4 ---------actualizamos la base de datos enviando el dataTable
    taParticipantes.Update(dtparticipantes)

End Sub

I have been testing and the problem itself is as follows:

  • I'm converting the textBox in full and sending it to the database is Bigint
  • For some reason it does not let me enter that integer in the field and that happens to me with all the bigInt fields in my database.
  • Here is the image of my table in Sql Server

        
    asked by Vicete Geovanny Franco Siles 25.11.2016 в 15:46
    source

    1 answer

    2
    • The main problem is that I use my pk as the entry field and I've fixed it by adding an additional column called real_id to add the id of the person.

    • The secondary problem arose when trying to parse a null data when left empty the field of equipment, then solved by validating that allows to send null.

    I apologize for taking your time, but it is not a reason to get angry and give a negative point to the question, if it is something incomprehensible you can ask for a better explanation of the point you expect the problem to be.

    Later I will show the final image

        
    answered by 25.11.2016 в 19:38