Dim MyConnection As System.Data.OleDb.OleDbConnection Try ''''''' Fetch Data from Excel 'Dim DtSet As System.Data.DataSet Dim MyCommand As System.Data.OleDb.OleDbDataAdapter MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _ "data source='" & PrmPathExcelFile & " '; " & "Extended Properties=Excel 8.0;") ' Select the data from Sheet1 of the workbook. MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [PDFDATA$] where id is not null", MyConnection) MyCommand.TableMappings.Add("Table", "Attendence") DtSet = New System.Data.DataSet MyCommand.Fill(DtSet) ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' DataGrid1.DataSource = DtSet.Tables(0) MyConnection.Close() Catch ex As Exception MyConnection.Close() End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)