May you help me fix my for loop in to get the result that I want. I am making a photo gallery where you can arrange it to the order you want when you upload the photo the use of this for loop is to basically make way for the newly added photo. (EX. I would like to upload the photo in the 10th slot and you already have 16 photos) It will turn the original 10th to 11th, 11th to 12th and so on. Here is my for loop
For counter = input To intPicOrder
Label4.Text = counter
myConnection.Close()
MyCommand.CommandText = "UPDATE photo SET PicOrder = " & Integer.Parse(plusone).ToString & " WHERE PicOrder ='" & Label4.Text & "'And FKCategoryId ='" & cmbCategory.SelectedItem.Value & "' "
MyCommand.Connection = myConnection
MyCommand.Connection = myConnection
MyCommand.Connection.Open()
MyCommand.ExecuteNonQuery()
MyCommand.Dispose()
MyReader.Close()
plusone = plusone + 1
Next counter
For counter = input To intPicOrder
Label4.Text = counter
myConnection.Close()
MyCommand.CommandText = "UPDATE photo SET PicOrder = " & Integer.Parse(plusone).ToString & " WHERE PicOrder ='" & Label4.Text & "'And FKCategoryId ='" & cmbCategory.SelectedItem.Value & "' "
MyCommand.Connection = myConnection
MyCommand.Connection = myConnection
MyCommand.Connection.Open()
MyCommand.ExecuteNonQuery()
MyCommand.Dispose()
MyReader.Close()
plusone = plusone + 1
Next counter