Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.
Sub Create_DataTable Dim dt As DataTable = GetDataTableFromCsv(sFileAndPath, False) End Sub Private Shared Function GetDataTableFromCsv(path__1 As String, isFirstRowHeader As Boolean) As DataTable Dim header As String = If(isFirstRowHeader, "Yes", "No") Dim pathOnly As String = Path.GetDirectoryName(path__1) Dim fileName As String = Path.GetFileName(path__1) Dim sql As String = "SELECT * FROM [" & fileName & "]" Using connection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & pathOnly & ";Extended Properties=""Text;HDR=" & header & """") Using command As New OleDbCommand(sql, connection) Using adapter As New OleDbDataAdapter(command) Dim dataTable As New DataTable() dataTable.Locale = CultureInfo.CurrentCulture adapter.Fill(dataTable) Return dataTable End Using End Using End Using End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.