Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Writing a text file from a DataSet
Message
 
To
04/12/2003 14:15:00
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00855990
Message ID:
00856103
Views:
16
If you want plain text files, try with something like this:
Dim fs As FileStream = New FileStream("c:\myfile.txt", FileMode.Create, FileAccess.ReadWrite)
Dim w As StreamWriter= New StreamWriter(fs)

w.AutoFlush = True
w.WriteLine("line 1")
w.WriteLine("line 2")
w.Close()
You'll need to loop thought rows and columns, though.


>Hi Bonnie,
>
>Thanks for the quick reply. I've been experimenting with WriteXml. I must be close, but I can't get straight text. I'm getting it in XML format.
>
>This is code the code I'm trying.
>
>Private Sub WriteXMLDocumentWithStreamReader()
>
> Dim xmlFilename As String = "NewTextFile.Txt"
>
> ' Create a new StreamWriter.
> Dim myStreamWriter As New System.IO.StreamWriter(xmlFilename)
>
> ' Use WriteXml to write the document.
> dsTEMPDATA.WriteXml(myStreamWriter)
>
> ' Close the FileStream.
> myStreamWriter.Close()
> End Sub
>
>If the dataset contains first name and last name, I would like the dataset to look like this in the text file:
>
>John Doe
>Jane Doe
>Billy Bob
>(and so on)
>
>Can you shed any light on the situation?
>
>Thanks again,
>Carl
Hector Correa
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform