Android Question Create a .txt file from a database

MarcioCC

Member
Licensed User
Longtime User
Good evening, I have a table named PRODUCTS created in sqllite, how do I export the data from this table to a .txt file and then download this .txt file to a server via usb cable.

The table has the fields:

CODBARRA PRIMARY KEY
QTDE

(S.ExecNonQuery2 ("INSERT INTO PRODUCTS (rowid, CODBARRAS, QUANTITY) VALUES (NULL,?,?)", Array As String (Edtdescr.Text, EdtQtde.Text))

C = s.ExecQuery ("SELECT CODBARRAS, QUANTITY FROM PRODUCTS ORDER BY CODBARRAS")

Lvadiciona.AddTwoLinesAndBitmap (C.GetString ("CODBARRAS"), C.GetString ("QUANTITY"), LoadBitmap (File.DirAssets, "ICONE LIXEIRA2.jpg"))


Does anyone have an example how do I do this ??
 

mangojack

Well-Known Member
Licensed User
Longtime User
please use code tags ... [code]insert code here ...[/code]
 
Upvote 0

eps

Expert
Licensed User
Longtime User
Upvote 0

MarcioCC

Member
Licensed User
Longtime User
Good morning, friend, it's going to work like this.
I will capture the data by cell phone save this data in my table (PRODUCTS) and export to a .txt .xls or csv file and send it to a server, where on that server has an ERP automation system where they will import this data.
 
Upvote 0

fixit30

Active Member
Licensed User
Longtime User
To save the data to a csv file use DBUtils.ExecuteMemoryTable to return your query as a List, then use StringUtils.SaveCSV to save to a csv file.
 
Upvote 0
Top