User-1831219222 posted
I tried few things those found on google but no luck. (I already installed office driver form here:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23734)
I have Win 7 Os (64-bit).
Anybody know the solution for this problem ?
Here is the code:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim sourceFilename As String = "data.txt"
Dim dt As New DataTable
Using TextConn As New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & Server.MapPath("") & ";" & _
"Extended Properties=""Text;HDR=Yes;FMT=Delimited;""")
TextConn.Open()
Dim cmd As OleDb.OleDbCommand = New OleDb.OleDbCommand("SELECT * FROM [" & sourceFilename & "]", TextConn)
cmd.CommandType = CommandType.Text
Dim da As New OleDb.OleDbDataAdapter(cmd)
da.Fill(dt)
TextConn.Close()
End Using
GridView1.DataSource = dt
GridView1.DataBind()
End Sub