Sub BindData()
Dim OpenFile As String
Dim i As Integer
OpenFile = "MyXls/Sheet1.xls"
'*** Create Excel.Application ***'
Dim xlApp As New Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet1 As Excel.Worksheet
xlBook = xlApp.Workbooks.Open(Server.MapPath(OpenFile))
xlBook.Application.Visible = False
xlSheet1 = CType(xlBook.Worksheets(1), Excel.Worksheet)
'*** Create DataTable ***'
Dim dt As New System.Data.DataTable
Dim dr As System.Data.DataRow
'*** Column ***'
dt.Columns.Add("id")
dt.Columns.Add("name")
dt.Columns.Add("lname")
For i = 2 To 4
'*** Rows ***'
dr = dt.NewRow
dr("id") = xlSheet1.Cells.Item(i, 1).ToString
dr("name") = xlSheet1.Cells.Item(i, 2).ToString
dr("lname") = xlSheet1.Cells.Item(i, 3).ToString
dt.Rows.Add(dr)
Next
'*** End DataTable ***'
'*** BindData To DataGrid ***'
Me.myRepeater.DataSource = dt
Me.myRepeater.DataBind()
'*** Quit and Clear Object ***'
xlApp.Application.Quit()
xlApp.Quit()
xlSheet1 = Nothing
xlBook = Nothing
xlApp = Nothing
End Sub