can any on help me for below update statement. and tell me where the mistake
Private Sub update_prosedure()
connection = New OleDbConnection(connetionString)
Dim cmd As New OleDb.OleDbCommand
' If Not connection.State = ConnectionState.Open Then
' connection.Open()
' End If
cmd.Connection = connection
Dim a As String = "UPDATE material Set ([NOREG]=@NOREG], [DATE]=[@DATE], [SUPPLIER]=[@SUPPLIER], [NOSJL]=[@NOSJL], [PO]=[@PO], [STYLE]=[@STYLE], [DESCRIPTION]=[@descrip], [COLOR]=[@COLOR], [SIZE]=[@SIZE], [QTY]=[@QTY], [UOM]=[@UOM], [NOCSTMBN]=[@NOCSTMBN]) WHERE [NOREG]=[@NOREG]"
With cmd.Parameters
.AddWithValue("@NOREG", txt_noreg.Text)
.AddWithValue("@DATE", txt_date.Text)
.AddWithValue("@SUPPLIER", txt_supplier.Text)
.AddWithValue("@NOSJL", txt_nosjl.Text)
.AddWithValue("@PO", txt_po.Text)
.AddWithValue("@STYLE", txt_style.Text)
.AddWithValue("@descrip", txt_descrip.Text)
.AddWithValue("@COLOR", txt_color.Text)
.AddWithValue("@SIZE", txt_size.Text)
.AddWithValue("@QTY", txt_qty.Text)
.AddWithValue("@UOM", cmb_uom.Text)
.AddWithValue("@NOCSTMBN", txt_nocstmbn.Text)
End With
connection.Open()
cmd.CommandText = a
' cmd = New OleDbCommand(a, connection)
cmd.ExecuteNonQuery()
ref_table()
connection.Close()
clear()
End Sub
Reply |
Reply with attachment |
Alert Moderator