Hi Ken,
I did some changes to the sample code you suggested me to read on link:
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53
Here is my code:
...
dgbase.DataSource = table 'dgbase is the datagrid,
'table is a DataTable
which already has columns
While reader.Read 'reader is a SqlDataReader
Dim row As DataRow
row = table.NewRow()
Dim tempObject(table.Columns.Count - 1) As Object
reader.GetValues(tempObject)
row.ItemArray = tempObject
table.Rows.Add(row) 'Add new row to dgbase.DataSource
dgbase.Refresh() 'show the new added row
End While
...
The above code works fine, except all the controls on the form do not
respond to any interaction while the records is loaded into datagrid.
I know I can solve this by using a separate thread to run the above code,
and I am working on it. hopefully it will be OK.
Thanks again, Ken.
"Kai Zhang" <ka*******@zeron.biz> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
Thanks for your reply, Ken.
for the first link:
http://www.vb-tips.com/default.aspx?...6-fc0d5c470f53
It allows user to know how much records have been loaded, and how long it
may take to finish loading the records, however, it does not allow user to
view the records quicker (unless update "Datagrid.DataSource" while
Datareader is reading records which may be very nasty, but I will have a
try).
for the second link:
http://www.vb-tips.com/default.aspx?...6-def86a1baeef
I am using the SQL 2000, so I cannot use this approach unless I implement
the NTile() by myself.