Ajit N

Ajit N

  • 1.3k
  • 352
  • 68.1k

how to fill datagridview with thousand of records quickly ?

Jul 6 2019 12:54 AM
Hello, I want to show thousand of records in datagridview within a second, i tried some code but it takes some minutes to show data in datagriview.
so help me how can i do this...
sample code below -
 
  1. public void BindData()  
  2.         {  
  3.             OleDbCommand cmd = new OleDbCommand("Select LC,Name from Ledger order by LC DESC", con);  
  4.             OleDbDataAdapter da = new OleDbDataAdapter(cmd);  
  5.             DataTable dt = new DataTable();  
  6.             da.Fill(dt);  
  7.             dataGridView1.DataSource = dt;  
  8.         }  
 

Answers (6)