Me edita el registro ... pero luego me sale error
Publicado por Enrique Rhenals B (36 intervenciones) el 26/07/2004 20:26:25
en el DataGrid11_UpdateCommand el me edita los registros pero luego me sale el error :
Dim producto, cantidad As String
producto = CType(e.Item.Cells(1).Controls(0), TextBox).Text
cantidad = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim strUpdate As String
strUpdate = "UPDATE detalle_factura SET "
strUpdate &= "cod_prod='" & producto & "', "
strUpdate &= "can_prod='" & cantidad & "', "
strUpdate &= "WHERE Cod_OrdComp='" & Txtcodpedido.Text & "' and dia_OrdComp='" & Txtdiapedido.Text & "' and mes_OrdComp='" & TxtMesPedido.Text & "' and ano_OrdComp='" & TxtYearPedido.Text & "' and cod_prov='" & CboProveedor.SelectedItem.Value & "' and cod_prod='" & modulo.var.valantproducto & "' "
Dim con As New OleDbConnection(strConnection)
Dim cmd As New OleDbCommand(strUpdate, con)
Try
con.Open()
Dim intUpdated As Integer
intUpdated = cmd.ExecuteNonQuery
lblStatus.Text = intUpdated.ToString & " Registros actualizados"
Catch err As Exception
lblStatus.Text &= err.Message
Finally
If Not con Is Nothing Then con.Close()
End Try
GRACIAS DE ANTEMANO !!!
Dim producto, cantidad As String
producto = CType(e.Item.Cells(1).Controls(0), TextBox).Text
cantidad = CType(e.Item.Cells(2).Controls(0), TextBox).Text
Dim strUpdate As String
strUpdate = "UPDATE detalle_factura SET "
strUpdate &= "cod_prod='" & producto & "', "
strUpdate &= "can_prod='" & cantidad & "', "
strUpdate &= "WHERE Cod_OrdComp='" & Txtcodpedido.Text & "' and dia_OrdComp='" & Txtdiapedido.Text & "' and mes_OrdComp='" & TxtMesPedido.Text & "' and ano_OrdComp='" & TxtYearPedido.Text & "' and cod_prov='" & CboProveedor.SelectedItem.Value & "' and cod_prod='" & modulo.var.valantproducto & "' "
Dim con As New OleDbConnection(strConnection)
Dim cmd As New OleDbCommand(strUpdate, con)
Try
con.Open()
Dim intUpdated As Integer
intUpdated = cmd.ExecuteNonQuery
lblStatus.Text = intUpdated.ToString & " Registros actualizados"
Catch err As Exception
lblStatus.Text &= err.Message
Finally
If Not con Is Nothing Then con.Close()
End Try
GRACIAS DE ANTEMANO !!!
Valora esta pregunta
0