Filling database with data from txt file

  • Thread starter Thread starter tiger79
  • Start date Start date
T

tiger79

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
 
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
 
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 ?
 
Back
Top