Gridview data into ms excel
while porting the gridview data into ms excel iam getting limited records(ex:1000) how i can get 10000 records at a time in asp.net 4.0 using c#.net
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
George ericPosted Apr 10, 2012, 1:48 AM
using(OleDbConnection oleDbConnection = new OleDbConnection())
{
oleDbConnection.ConnectionString = this.textBox1.Text;
OleDbCommand oleDbCommand = new OleDbCommand();
oleDbCommand.CommandText = this.textBox2.Text;
oleDbCommand.Connection = oleDbConnection;
using(OleDbDataAdapter da = new OleDbDataAdapter(oleDbCommand))
{
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
}
}
Or you can merge several related Excel , in that way excel should send no bad message