|
Take a look at the MS KB article titled "How-to: Use ADO.NET to Retrieve and Modify Records in an Excel Workbook With Visual Basic .NET."
Basically, it explains that you can use an OleDbConnection component to connect to the Excel workbook, using a connection string like the following:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Book1.xls;Extended Properties="Excel 8.0;HDR=YES;"
The version of Excel depends on the workbook you're opening, and can be: "5.0" for Microsoft Excel 5.0 and 7.0 (95) and "8.0" for Microsoft Excel 8.0 (97), 9.0 (2000) and 10.0 (2002) workbooks. Once you have a connection to the workbook, you can use a DataAdapter and a Dataset just like against any database.
|