Question : Add datarow to datatable +vb.net 2005

Hi,
I am trying to add datarow to datatable.As the my query is returing 10000 rows and I need to show every row being added to grid .This is very slow.Any suggestions on how to improve performance.
Cheers

Answer : Add datarow to datatable +vb.net 2005

You can try this way (check the code snippet) and if it's also slow, you can use a BackGroundWorker to populate the grid (it will not froze the form)
1:
2:
3:
4:
5:
6:
7:
8:
            Dim connString As String = "..."
            Using da As New SqlDataAdapter("SELECT * FROM TableName", connString)
                Using ds As New DataSet
                    da.Fill(ds)
                    Me.DataGridView1.DataSource = ds.Tables(0).DefaultView
                End Using
            End Using
Random Solutions  
 
programming4us programming4us