This operation cannot be performed while resizing an autocomplete column.

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 Can’t find the problem related to this on the Internet, what should I do? I am trying to subtract 1 quantity on SqlDB when the user borrowed it. Yes! it executes sql command, but im has this type of error.

bsource = SDA binding source = MysqlAdapter

0
source share
1 answer

You can try paste

 DatarGidView1.SuspendLayout 

in front of the line where the error occurs, and

 DataGridView1.ResumeLayout 

after him, although I'm not sure if this will work

0
source

All Articles