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 -
- public void BindData()
- {
- OleDbCommand cmd = new OleDbCommand("Select LC,Name from Ledger order by LC DESC", con);
- OleDbDataAdapter da = new OleDbDataAdapter(cmd);
- DataTable dt = new DataTable();
- da.Fill(dt);
- dataGridView1.DataSource = dt;
- }

Željko PerićRank #644 · 3.7K reputationPosted Jul 5, 2019, 11:01 PM EDT
In the Layout section there are two options that directly influence on the execution speed of "Fill" and "Show" methods of the DataGridView. See image:
I hope that this would lead You to the solution of Your problem.
Rajanikant HawaldarRank #108 · 20.5K reputationPosted Jul 6, 2019, 1:43 AM EDT
Rajanikant HawaldarRank #108 · 20.5K reputationPosted Jul 6, 2019, 1:44 AM EDT
Rajanikant HawaldarRank #108 · 20.5K reputationPosted Jul 6, 2019, 1:46 AM EDT
Amit GuptaRank #190 · 12.8K reputationPosted Jul 6, 2019, 9:16 AM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Nov 23, 2019, 7:43 AM EST