Dim su As StringUtils
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT col1, col2, col3 FROM table1")
Dim list1 As List
list1.Initialize
Dim cols() As String
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
cols = Array As String(Cursor1.GetString2(0), Cursor1.GetString2(1), Cursor1.GetString2(2))
list1.Add(cols)
Next
Cursor1.Close
su.SaveCSV2(File.DirRootExternal, "db.csv", ",", list1, Array As String("col1", "col2", "col3"))
Sub BtInvia_Click
'recuperiamo i dati da inserire nel file csv da inviare
Dim su As StringUtils
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT IdOrd,IdCli,IdArt,DesArt,Um,QtaOrd,QtaOma,ImpUni,Sconto1,Sconto3,Sconto3,Sconto4,AliIva,DataCons,NoteOrd from ORDINI where DataExp = ''")
Dim list1 As List
list1.Initialize
Dim cols() As String
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
cols = Array As String(Cursor1.GetString2(0), Cursor1.GetString2(1), Cursor1.GetString2(2), Cursor1.GetString2(3), Cursor1.GetString2(4), Cursor1.GetString2(5), _
Cursor1.GetString2(6), Cursor1.GetString2(7), Cursor1.GetString2(8), Cursor1.GetString2(9), Cursor1.GetString2(10), Cursor1.GetString2(11), Cursor1.GetString2(12), _
Cursor1.GetString2(13), Cursor1.GetString2(14))
list1.Add(cols)
Next
Cursor1.Close
su.SaveCSV2(File.DirRootExternal, "ordini.csv", ",", list1, Array As String("col1","col2","col3","col4","col5","col6","col7","col8","col9","col10","col11","col12","col13","col14"))
'FTP.UploadFile(File.DirRootExternal, EditText1.Text, True, "1.txt")
End Sub
Dim su As StringUtils
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT Seriale,IdOrd,IdCli,IdArt,Um,QtaOrd,QtaOma,ImpUni,Sconto1,Sconto2,Sconto3,Sconto4,AliIva,DataCons,NoteOrd from ORDINI where DataExp = 'N'")
Dim list1 As List
list1.Initialize
Dim cols() As String
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
cols = Array As String(Cursor1.GetString2(0), Cursor1.GetString2(1), Cursor1.GetString2(2), Cursor1.GetString2(3), Cursor1.GetString2(4), Cursor1.GetString2(5), _
Cursor1.GetString2(6), Cursor1.GetString2(7), Cursor1.GetString2(8), Cursor1.GetString2(9), Cursor1.GetString2(10), Cursor1.GetString2(11), Cursor1.GetString2(12), _
Cursor1.GetString2(13), Cursor1.GetString2(14))
list1.Add(cols)
Next
Cursor1.Close
su.SaveCSV2(File.DirRootExternal, "ordini.csv", ",", list1, Array As String("Seriale","IdOrd","IdCli","IdArt","Um","QtaOrd","QtaOma","ImpUni","Sconto1","Sconto2","Sconto3","Sconto4","AliIva","DataCons","NoteOrd"))
su.SaveCSV2(File.DirRootExternal, "ordini.csv", ",", list1, Array As String("Seriale","IdOrd","IdCli","IdArt","Um","QtaOrd","QtaOma","ImpUni","Sconto1","Sconto2","Sconto3","Sconto4","AliIva","DataCons","NoteOrd"))
Dim ListOfMaps As List
ListOfMaps.Initialize
Dim rows As List = StringUtils.LoadCSV(...)
For Each row() As String In rows
ListOfMaps.Add(CreateMap("Column1": row(0), "Column2": row(1) ,...)) ' make sure that the column names are correct
Next
DBUtils.InsertMaps(SQL1, "Table1", ListOfMaps)
fecha=DateTime.Date(DateTime.Now)
hora=DateTime.GetHour(DateTime.Now)&":"&DateTime.GetMinute(DateTime.Now)
mes=DateTime.GetMonth(DateTime.Now)
año=DateTime.GetYear(DateTime.Now)
Dim su As StringUtils
Dim Cursor1 As Cursor
Cursor1 = informes.ExecQuery("SELECT FECHA, HORA, FASE, FRECUENCIA, FACTOR_DE_POTENCIA, VOLTAJE, CORRIENTE, POTENCIA, POTENCIA_REACTIVA, POTENCIA_APARENTE, ENERGIA, hola, TENSION_COMPUESTA FROM informe")
Dim list1 As List
list1.Initialize
Dim cols() As String
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
cols = Array As String(Cursor1.GetString2(0), Cursor1.GetString2(1), Cursor1.GetString2(2), Cursor1.GetString2(3), Cursor1.GetString2(4), Cursor1.GetString2(5),Cursor1.GetString2(6), Cursor1.GetString2(7), Cursor1.GetString2(8), Cursor1.GetString2(9), Cursor1.GetString2(10), Cursor1.GetString2(11),Cursor1.GetString2(12))
list1.Add(cols)
Next
Cursor1.Close
If list1.Size > 0 Then
su.SaveCSV2(File.DirRootExternal, "Informes_"&mes&"-"&año&".csv", ",", list1, Array As String("FECHA", "HORA", "FASE","FRECUENCIA", "FACTOR DE POTENCIA", "VOLTAJE","CORRIENTE", "POTENCIA", "POTENCIA REACTIVA","POTENCIA APARENTE", "ENERGIA", " ", "TENSION COMPUESTA"))
Else
ToastMessageShow("No hay datos suficientes",True)
End If