Topic: LoadFromTextFile

Hello all,


In the Method and Property of the TablegGrid, we find SaveToTextFile, and LoadFromTextFile.


I successfully exported multiple files which content were based on tablegrids, that works fine.


The import on the other hand is a little obscure to me.


I do not want to used a temporary sqlite.db file (I know how to do that), because what I plan to do is :

1- import a file content in the TableGrid
2- connect online to a Mysql database
3- upload and save the content of the Tablegrid to the server


So I built a small project in which, after clicking on a button and selecting a txt file, the content of the file is displayed in the TableGrid.


That works... except that the TableGrid only show numbers when there is also text in my file.


Any idea what I'm doing wrong ?


Try it if you want, the project is attached and the txt file is called export.txt, in the same folder as the project.


Cheers


Mathias

Post's attachments

Attachment icon 2016-drama_uploader.zip 334.76 kb, 560 downloads since 2016-01-20 

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: LoadFromTextFile

Hello,


That works... except that the TableGrid only show numbers when there is also text in my file.

It's bug, I will test it, thanks.


You should not to use TableGrid for import data, please check out this example for import data:
http://myvisualdatabase.com/forum/viewtopic.php?id=1448

Dmitry.

Re: LoadFromTextFile

Thanks Dmitry,


Of course I checked the forum before asking my question, and I saw and studied that example.

But as we can not connect to sqlite AND Mysql with the same application, I can not use the sqlite import first and then display in Tablegrid... it has to go from file to tablegrid and then from tablegrid to mysql... well... ideally. It's just so that the user can see what he is going to export.


Can you tell my why

You should not to use TableGrid for import data


Mathias

I'm a very good housekeeper !
Each time I get a divorce, I keep the house

Zaza Gabor

Re: LoadFromTextFile

Surely, you can use TableGrid just to allow user to preview data, but It does not make sense to use TableGrid for import data to  database.

Dmitry.