当自动填充的列正在调整大小时,无法执行此操作 [英] This operation cannot be performed while an auto-filled column is being resized

查看:688
本文介绍了当自动填充的列正在调整大小时,无法执行此操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试
MysqlConn.Open()
对于i As Integer = Me.DataGridView1.SelectedRows.Count - 1到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 =新建MySqlCommand(Query2,MysqlConn)
SDA.SelectCommand = COMMAND
SDA.Fill(dbDataSet)
bSource.DataSource = dbDataSet
**错误** Me.DataGridView1.DataSource = bSource **错误**
SDA.Update(dbDataSet)
TextBox2.Text =
MessageBox.Show(成功,知情 ,MessageBoxButtons.OK,MessageBoxIcon.Information)
下一个
MysqlConn.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
最后
MysqlConn.Dispose()
结束尝试
结束子

我不能在互联网上找到一个相关的问题我该怎么办?当用户借用它时,我试图在SqlDB上扣除1个数量。是!它执行sql命令,但我有这种类型的错误。



bsource =绑定源
SDA = MysqlAdapter

解决方案

您可以尝试插入

  DatarGidView1.SuspendLayout 

在发生错误的行之前,

  DataGridView1.ResumeLayout 

之后,虽然我不知道是否会工作


     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

解决方案

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

这篇关于当自动填充的列正在调整大小时,无法执行此操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆