all groups > dotnet compact framework > april 2004 >
You're in the

dotnet compact framework

group:

Filling database with data from txt file


Filling database with data from txt file tiger79
4/30/2004 2:53:49 PM
dotnet compact framework:
Hi,
i'd like to read data out of a text file directly into an SqlCe database.
The textfile is something like this :

1;0;parent1;
2;0;parent2;
3;0;parent3;
4;1;child1parent1;
5;1;child2parent1;
6;2;child1parent2;

so first number would be like an ID, second would be a parent_ID, and the
last one some description.
I don't know which charatcer is best used to separate data, I accept tips on
that :)

How do I manage to read it directly into the SQLCe database ? What is best
used, the Streamreader class ?
thanks

Re: Filling database with data from txt file Peter Foot [MVP]
4/30/2004 3:05:08 PM
A common format for text file data is comma delimited (.csv). OpenNETCF's
Smart Device Framework contains a DataAdaptor which will load your csv file
into a DataSet, you can then load this into your database.
www.opennetcf.org/sdf/

Peter

--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com | www.opennetcf.org

[quoted text, click to view]

Re: Filling database with data from txt file tiger79
5/3/2004 10:04:18 AM

ok, but if I understand this right it will load the data twice ? Once in the
dataset and once in my database ? How about loading it only in the dataset
adn would this support sql-statements to etrieve data out of a dataset ?

[quoted text, click to view]

AddThis Social Bookmark Button