Update query problem

  • Thread starter Thread starter Houssem12
  • Start date Start date
H

Houssem12

Guest
HI eveyone

i have a datagridview which have a column called "Numero" same exist in database after fill that column i some time make an update and first it goes normal and after i dont unserstand in update once make the update once no

this my code

For i = 0 To DataGridView1.Rows.Count - 1
Dim usb As New SqlCommand("select Numseq from DetailReceptionFrs where Numero='" & TextBox1.Text & "' and Codearticle='" & DataGridView1.Rows(i).Cells(1).Value & "'", cn)
Dim ttt As New SqlDataAdapter(usb)
ttt.Fill(qqs23)


If cn.State = ConnectionState.Open Then
cn.Close()
End If
cn.Open()

Using cmd1 As New SqlCommand("update DetailReceptionFrs set NumeroEnsemble=@NumeroEnsemble,Marge=@Marge where Numero='" & TextBox1.Text & "' and Numseq='" & qqs23.Rows(i).Item("Numseq") & "'", cn)
With cmd1.Parameters
.Add("@NumeroEnsemble", SqlDbType.NVarChar).Value = (DataGridView1.Rows(i).Cells(7).Value)
.Add("@Marge", SqlDbType.NVarChar).Value = (DataGridView1.Rows(i).Cells(8).Value)
End With
cmd1.ExecuteNonQuery()
End Using


Next

nothing return for error just i enter the new value and refresh nothing happing

what i can do please help?

Continue reading...
 
Back
Top