Hassle-free live chat software re-imagined for business growth. 2 users, always free.
Private Function GetDataADO(ByVal Path As String) As DataTable Dim Filename As String = IO.Path.GetFileName(Path) Dim FilePath As String = IO.Path.GetDirectoryName(Path) Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties= ""Text;HDR=No;IMEX=1;"" ; Data Source=" & FilePath Dim Connection As New OleDb.OleDbConnection(ConnectionString) Connection.Open() Dim Command As New OleDb.OleDbCommand Command.CommandType = CommandType.Text Command.Connection = Connection Command.CommandText = "SELECT * FROM [" & Filename & "]" Dim DataTable As New DataTable Dim DataAdapter As New OleDb.OleDbDataAdapter(Command) DataAdapter.Fill(DataTable) Connection.Close() Connection.Dispose() Return DataTable End Function
|How to use odbc in vb to connect to ms sql||14||38|
|Vb.net dynamic formulas in runtime||11||62|
|Index was out of range. Must be non-negative and less than the size of the collection parameter name:index||10||28|
|.NET tools for adding thread safety to a web app?||3||14|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
15 Experts available now in Live!