Sure ! The easiest way is to iterate through the dataset [I'm assuming one
data row -> one text line], converting each row to an appropriate text
representation [append column data and delimiters to a StringBuilder object
?], and then writing the text line out; this continues until the whole
dataset has been processed.
You would roughly proceed as follows:
open text file stream
foreach Row in Dataset
foreach Column in Row
append column and delimter to textline
write textline
close text file stream
Note that you will have replaced the existing text file rather than having
updated parts of it as you would with a dataset; it's generally easier to do
this than trying to randomly move through the file updating it.
DataSet has methods to write and load xml serialization
DataSet.ReadXml
DataSet.WriteXml
If you are using a not strong typed dataset, you'll probabily save also the
dataset schema
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.