hi guys , i have a problem with my loading/refresh record in my form.
i have only almost 500 record and take so long before refreshing/display the data. i have a user input form where user enter their record and while saving(direct to the database) and refreshing data i just call only my function getrec ().

pls give me some idea to fix this problem.
pls take a look

Dim ActiveTable As New DataTable
Private Sub frmRef_Userlist_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        getrec
End Sub
Private Sub dtBind(ByVal dt As DataTable)
        'slow start here
        bs.DataSource = ActiveTable 'binding
        'slow end here

        bs.MoveFirst()
        bn.BindingSource = bs
        dgv1.DataSource = bs 'listview
        CloseMainCon() 'closing connection

End Sub
private sub getrec
       SqlString = "SELECT " & Tbl_Fields & " FROM " & Tbl_Name & " order by xcode desc"
        ActiveTable = OpenRSTable(SqlString)
        dtBind(ActiveTable)
end sub

`

You can emplement some form of Data Paging to speed the process up.

For exmaple: Query in 100 records at a time then post those out to your control.

If the user starts scrolling the control, and is nearing the bottom - add another 100. Rinse and repeat!

can you provide any code/link. just for my reference.
also even 400 record it is normal to react that kind of slowdown?

what is bs? try to clear if its a container then fill it again or try Begginnerdev's suggestion.

even 400 record it is normal to react that kind of slowdown?

From my experience (limited) I have had 700+ records queried in take less than a second. (All codebehind using a data reader/adapter and writing my own fill functions.)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.