C# .NET - how to create connection with MS Excel and to read the data of excel file into gridview

Asked By Sunil Kumar on 13-May-13 05:58 AM
Danasegarane Arunachalam replied to Sunil Kumar on 13-May-13 10:37 AM
Hope this helps

Saqib Razzaq replied to Sunil Kumar on 13-May-13 10:50 AM
One way is to to use OLEDB, read the article at http://www.codeproject.com/Articles/8500/Reading-and-Writing-Excel-using-OLEDB. You can also download the sample project there.

Another way is to use a component like Aspose.Cells, which have more control on reading and writing Excel files. Please see the example at http://www.aspose.com/docs/display/cellsnet/Exporting+Data+from+Worksheets for exporting data from Excel to DataTable and loading in a DataGridView control.
Danasegarane Arunachalam replied to Saqib Razzaq on 14-May-13 02:07 AM
The Link uses OLEDB only.