Sub queryx
Dim query1 As String = ""
If sql1.IsInitialized = False Then
If File.Exists(File.DirApp,"..\data.db") = True Then
sql1.InitializeSQLite(File.DirApp,"..\data.db", False)
sql2.InitializeSQLite(File.DirApp,"..\data.db", False)
Else
fx.Msgbox(MainForm,"Data not found","Alert")
End If
End If
For i = 0 To ListView1.Items.Size-1
Label1.Text = i
Dim lb As Label = ListView1.Items.Get(i)
Dim li As List =lb.Tag
'verifico presenza telefono, se non è presente lo cerco nel index 8 se anche qui non presente
'allora gerero un indice provvisorio
If li.Get(7) = "" Or li.Get(7) = " " Then
li.Set(7, li.Get(8))
If li.Get(7) = "" Or li.Get(7) = " " Then
DateTime.DateFormat = "ddMMyyyyhhmmss"
li.Set(7,DateTime.Date(DateTime.Now) & "-" & Rnd(1,1000))
End If
End If
Try
query1="INSERT INTO data1 Values (name,phone,email,client,production,canal,log)"
Dim lix As List
lix.Initialize
lix.Add(Regex.Replace("'",li.get(1),"''"))
lix.Add(Regex.Replace(" ",li.get(7),""))
lix.Add(Regex.Replace(" ",li.get(9),""))
lix.Add("Business - " & Regex.Replace("'",li.get(0),"''"))
lix.Add("Altro")
lix.Add("4Dem")
lix.Add(DateTime.Date(DateTime.Now))
sql1.AddNonQueryToBatch(query1,lix)
query1="INSERT INTO data2 Values (address,city,zipcode,lat,long,relationship,log)"
Dim lix As List
lix.Initialize
lix.Add(Regex.Replace("'",li.get(2),"''"))
lix.Add(Regex.Replace("'",li.get(4) & " " & li.Get(5),""))
lix.Add(Regex.Replace(" ",li.get(3),""))
lix.Add("0")
lix.Add("0")
lix.Add(Regex.Replace(" ",li.get(7),""))
lix.Add(DateTime.Date(DateTime.Now))
sql1.AddNonQueryToBatch(query1,lix)
Catch
Log("error ecption " & i & " " & li.Get(1) )
End Try
Next
Dim SenderFilter As Object = sql1.ExecNonQueryBatch("SQL")
Wait For (SenderFilter) SQL_NonQueryComplete (Success As Boolean)
Log("NonQuery: " & Success)
End Sub