Imports System.Data.OleDb
Public Class Form1
Public G_Conn As New SqlClient.SqlConnection
Public G_OH As New SqlClient.SqlConnection
Private Sub BT_convert_Click(sender As Object, e As EventArgs) Handles BT_convert.Click
Dim cn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & My.Computer.FileSystem.GetParentPath(txt_countFolder.Text) & ";Extended Properties=""text;HDR=No;FMT=Delimited;"";"
Dim N As Integer
Dim str As String
Dim dt As New DataTable
For N = 0 To lsv.Items.Count - 1
str = lsv.Items(N).Text
Application.DoEvents()
ToolStripStatusLabel1.Text = "Convent CSV to Database :: " & str
st1.Update()
Using cmd As New OleDbDataAdapter("select * from [" & str & "]", cn)
'cn.Open()
cmd.Fill(dt)
End Using
'cn.Close()
Next
Tag : .NET, Ms SQL Server 2014, Excel (Excel.Application), VB.NET, Windows