If File.Exists(sdRoot, "clienti.csv") = True Then
Msgbox("clienti","")
TxtLog.Text = "Inserimento Dati Tabella Clienti..." &Chr(10)&TxtLog.Text
SQL1.BeginTransaction
Dim Reader As TextReader
Reader.Initialize(File.OpenInput(sdRoot, "clienti.csv"))
Try
Dim line As String
Reader.ReadLine
line = Reader.ReadLine
Msgbox(line,"inizio")
Do While line <> Null
Dim j As Int
j = j + 1
' line = Reader.ReadLine
Dim ColumnContent() As String
ColumnContent = Regex.Split(";", line)
TxtLog.Text = "Inserimento Cliente: " &ColumnContent(0) &" - "&ColumnContent(1)&Chr(10)&TxtLog.Text
For i = 0 To 12
ColumnContent(i) = ColumnContent(i).Replace(QUOTE, "")
' ColumnContent(i) = ColumnContent(i).Replace(".", " ")
ColumnContent(i) = ColumnContent(i).Replace(",", " ")
' If ColumnContent(i) = "." Then
' ColumnContent(i) = " "
' End If
' Msgbox(ColumnContent(i),"")
Next
SQL1.ExecNonQuery2("INSERT INTO Clienti VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?)", Array As Object (ColumnContent(0), ColumnContent(1), ColumnContent(2), ColumnContent(3), ColumnContent(4), ColumnContent(5), ColumnContent(6), ColumnContent(7), ColumnContent(7).SubString2(0,1), ColumnContent(8), ColumnContent(9), ColumnContent(10), ColumnContent(11), ColumnContent(12)))
Msgbox(line,"fine")
DoEvents
Loop
Catch
Log(LastException.Message)
End Try
Reader.Close
SQL1.TransactionSuccessful
SQL1.EndTransaction
End If