问题
Try
MysqlConn.Open()
For i As Integer = Me.DataGridView1.SelectedRows.Count - 1 To 0 Step -1
Dim Query2 As String
Query2 = "Update blist SET quantity=(quantity-1) where quantity = '" & Me.DataGridView1.SelectedRows(i).Cells(0).Value.ToString & "' "
COMMAND = New MySqlCommand(Query2, MysqlConn)
SDA.SelectCommand = COMMAND
SDA.Fill(dbDataSet)
bSource.DataSource = dbDataSet
**error**Me.DataGridView1.DataSource = bSource**error**
SDA.Update(dbDataSet)
TextBox2.Text = ""
MessageBox.Show("Success", "Informed", MessageBoxButtons.OK, MessageBoxIcon.Information)
Next
MysqlConn.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
MysqlConn.Dispose()
End Try
End Sub
i Cannot find a related problem into this in the internet what should i do? I am trying to deduct 1 quantity on the SqlDB when the user borrowed it. Yes! it execute the sql command but im having this this type of error.
bsource= Binding source SDA = MysqlAdapter
回答1:
You could try inserting
DatarGidView1.SuspendLayout
before the line where the error occurs, and
DataGridView1.ResumeLayout
after it, though I'm not sure if that would work
来源:https://stackoverflow.com/questions/34334647/this-operation-cannot-be-performed-while-an-auto-filled-column-is-being-resized