Dim odcell = OutgoingdeliveriesDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value.ToString()
Using _conn As New MySqlConnection("Server = localhost; Username= root; Password =; Database = forms")
Using cmd
With cmd
MsgBox("Connection Established")
.Connection = _conn
.Parameters.Clear()
.CommandText = "SELECT FormName, Description FROM FormMaintenance WHERE FormCode = @Code"
.Parameters.AddWithValue("@Code", odcell)
_conn.Open()
Dim dr As MySqlDataReader
dr = cmd.ExecuteReader()
If dr.Read() Then
Using _comm As New MySqlCommand()
With _comm
.Connection = _conn
.CommandText = "UPDATE outgoingdeliveries SET FormName = @iName, Description = @iDesc WHERE FormCode = @iCode"
.CommandType = CommandType.Text
.Parameters.AddWithValue("@iCode", odcell)
.Parameters.AddWithValue("@iName", dr.Item(0).ToString())
.Parameters.AddWithValue("@iDesc", dr.Item(1).ToString())
dr.Close()
End With
Try
_comm.ExecuteNonQuery()
Catch ex As MySqlException
MsgBox(ex.Message.ToString())
End Try
End Using
End If
End With
End Using
End Using
my outgoingtable doesnt update ,please help .thank you