title: Filling DataTable as source of DataGridView is very slow
body: <p>So, here is a case where I have more than 40.000 rows in my database.<br>
  When I start <code>Select * from Table</code> it gets me result set in less than a second.<br>
  But, when I want to fill DataTable with those rows and than show it in DataGridView it takes forever to show (Around 15-20 seconds).  </p>
  
  <p>Why is that?  </p>
  
  <p>My code:  </p>
  
  <pre><code>Public Shared Function FillDTwithSQL(ByVal StoredProc As String, ByVal table As DataTable) As DataTable
          Dim cmd As SqlCommand = CreateCommand(SProcedura)
          Dim dt As New DataTable("dt")
          dt = table
          dt.Rows.Clear()
          Try
              If adoConnection.State = ConnectionState.Closed Then adoConnection.Open()
              dt.Load(cmd.ExecuteReader(CommandBehavior.Default))
          Catch ex As Exception
              MsgBox("Greska: " &amp; ex.ToString)
              Error = True
              Error_text = ex.ToString
          End Try
          adoConnection.Close()
          Return dt
      End Function 
  Public Shared Function CreateCommand(ByVal SProcedura As String) As SqlCommand
          CreateConnection(ConnectionSetup.ConnectionString)
          Dim cmd As New SqlCommand(ConnectionSetup.DataBaseName &amp; ".dbo." &amp; SProcedura, adoConnection)
          cmd.CommandType = CommandType.StoredProcedure
          Return cmd
      End Function 
  Private sub FillDGV()
  DataBaseLayer.FillDTwithSQL("SelectProc", ds_Tables.Table)
              Me.DataGridView1.DataSource = dds_Tables.Table
              Me.DataGridView1.ClearSelection()
  End Sub
  </code></pre>