Sub Page_Load(sender As Object, e As EventArgs)
Dim dt As DataTable
'*** Csv to DataTable ***'
dt = CsvCreateDataTable()
'*** BindData to Repeater ***'
myRepeater.DataSource = dt
myRepeater.DataBind()
End Sub
'*** Convert CSV to DataTable ***'
Function CsvCreateDataTable() As DataTable
Dim objConn As New OleDbConnection
Dim dtAdapter As OleDbDataAdapter
Dim dt As New DataTable
Dim strConnString As String
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="&Server.MapPath("csv/") & _
";Extended Properties='TEXT;HDR=Yes;FMT=Delimited;Format=Delimited(,)'"
objConn = New OleDbConnection(strConnString)
objConn.Open()
Dim strSQL As String
strSQL = "SELECT * FROM customer.csv"
dtAdapter = New OleDbDataAdapter(strSQL, objConn)
dtAdapter.Fill(dt)
dtAdapter = Nothing
objConn.Close()
objConn = Nothing
Return dt '*** Return DataTable ***'
End Function