Ver Mensaje Individual
  #5 (permalink)  
Antiguo 22/03/2015, 16:14
jeffersonvasconez
 
Fecha de Ingreso: marzo-2015
Ubicación: ecuador
Mensajes: 2
Antigüedad: 9 años, 1 mes
Puntos: 0
Respuesta: Modificar base de datos desde datagrid (vb.net)

a mi me pasa lo mismo con este codigo ya lo solucionaron como lo hicieron

sql = "UPDATE VENTA SET DSCTO='" & TextBox1.Text & "',IVA='" & TextBox4.Text & "',TOTALAPAGAR='" & TextBox9.Text & "',DESCUENTO='" & TextBox15.Text & "',PRECIOTOTAL='" & TextBox8.Text & "' WHERE NUMFACTV=" & TextBox7.Text & ""
comm.CommandText = sql
Try
comm.ExecuteNonQuery()
MsgBox("Factura modificada exitosamente", MsgBoxStyle.Information, "SISTEMA DE VENTAS")
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Information, "SISTEMA DE VENTAS")
End Try
'For i As Integer = 0 To DataGridView1.Rows.Count - 1
For Each row As DataGridViewRow In DataGridView1.Rows
sql = "UPDATE TVENTA SET CANTIDAD='" & row.Cells(2).Value.ToString & "',VALORUNIT='" & row.Cells(3).Value.ToString & "',VALORTOTAL='" & row.Cells(4).Value.ToString & "' WHERE NUMFACTV=" & TextBox7.Text & ""
comm.CommandText = sql
Try
comm.ExecuteNonQuery()
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Information, "SISTEMAS DE VENTAS")
End Try
Next
'Next