Hi all,

I have a VB 2008 connected to my localhost SQL using DataGridview, BindingSource and DataTable.
All works fine, i can add, edit and delete the row and the SQL database is also affected.

However, there is one thing that bugs me, that is sorting.

Problem
My table in this database is still quite empty, it only has 6 rows

However, if I spam-click the column header, the sorting seems taking some time to sort, so that, the sorting result does not follow my mouse spam-clickings

Note:
Spam Click = Clicking the mouse button in high frequency, something like click click click click click click click click click, etc

I then make a debug button to check this

Code:
Variables:
Dim DebugInt As Integer = 0
Dim bs As New BindingSource


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If DebugInt = 0 Then
            bs.Sort = "name desc"
            DebugInt = 1
        Else
            bs.Sort = "name asc"
            DebugInt = 0
        End If

    End Sub
If I spam-click this debug button, the sorting is fast and follows my clickings.

Why clicking my debug button gives better and faster result than clicking the column header to sort?
Why is this happening?


I am not really sure if my explanation above is clear enough.
Please help me solving this problem so that spam-clicking the column header sorts the table in a quick time

I am looking forward to hearing from you

Regards,
ryonn