Download data(vb.net) to text file

Hello!
Currently, i am able to download my data from VB.NET to excel file.

Unfortunately, some users' PC do not have MS EXCEL. Therefore i need to download the data directly into text file. Is there any script to download the data into TEXT FILE (.csv / .txt / .prn).

Please help me.

TQ!
[328 byte] By [eileen] at [2007-11-19 21:50:06]
# 1 Re: Download data(vb.net) to text file
Hi,

if I understand you correctly you want to save data from your application to a text file? "Download" usually refers to retrieving something from the internet ...

Anyway - here is some code to store somthing into a text file:

Using sw As StreamWriter = New StreamWriter ("c:\testfile.txt")
' Add some text to the file
sw.Write("This is a test!")
' Add a line of text to the file
sw.WriteLine("This is a testline")
sw.Close()
End Using

What and how you format the stuff you write to the file depends on your application obviously.

Hope this helps - best regards - Peter Weiss
MacSass at 2007-11-10 3:13:42 >
# 2 Re: Download data(vb.net) to text file
Or you could download the Excel app that opens excel files read-only. it's free for distribution.
dglienna at 2007-11-10 3:14:40 >
# 3 Re: Download data(vb.net) to text file
thanks for your guidance.

Currently i am able to create the text file(download) using the OleDbDataReader. But the format range is not in proper order. I use the 'TAB' ascii code to make it separate by tab key so that it is a space between the column.

Anyway when i upload again this text file into this system, i could'nt get the fix location. What should i do inorder to upload this text file into system again ?

Thanks.
eileen at 2007-11-10 3:15:49 >