Originally Posted by jmcilhinney
This is a relatively easy thing to do.
Originally Posted by nov0798
First establish a connection to the Excel File.
Connection string will look something like this.
Next write a query to fetch records from an excel worksheet.
Dim myexcelFile As String = "c:\temp\myfile.xls"
Dim connectStr As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & myexcelFile & ";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"";"
Dim dataTable As DataTable = PopulateDataTable(connectStr)
Dim con As New OleDbConnection(connectStr)
Const qry As String = "SELECT * FROM [Sheet1$]"
Dim odp As New OleDbDataAdapter(qry, con)
Now you have your basic data table. You can use LINQ to manipulate the contents of this table every which way you want.