View Single Post
Join Date: Dec 2008
Posts: 9
Reputation: Evil03 is an unknown quantity at this point 
Solved Threads: 0
Evil03 Evil03 is offline Offline
Newbie Poster

Export Data to Notepad

 
0
  #1
Jan 2nd, 2009
Hi All,

I have created a Vb.net application with back as MS.Access..I shall be very thankful if someone pls guide me on how to EXPORT DATA from the VB>NET Textboxes to NOTEPAD..

THe methof that i am using is creating a CSV file which is can Adjust in excel after copying data from notepad to excel...

BUT MY CUSTOMER WANTS SOMETHINGS LIKE BELOW PATTERN
  1. NAME POSITION COUNSELE BY DATE
  2. abc abc abc 123
  3. xyz xyz xyz 123
  4. aaa aaa aaa 123
Pls help me to fix this issue.....

Below is my code
  1. Private Sub btnnotepad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnnotepad.Click
  2.  
  3.  
  4. Dim filename As String = "C:\Documents and Settings\Acer\Desktop\CounsellingSystem\Counsellrecords.txt"
  5.  
  6. Dim lineoftext As String
  7. Dim arytext(5) As String
  8.  
  9.  
  10. arytext(0) = txtname.Text
  11. arytext(1) = txtnpos.Text
  12. arytext(2) = txtcname.Text
  13. arytext(3) = txtcpos.Text
  14. arytext(4) = DateTimePickerdoc.Value.ToShortDateString
  15. arytext(5) = DateTimePickerrd.Value.ToShortDateString
  16.  
  17. lineoftext = String.Join(";", arytext)
  18.  
  19. Dim objwriter As New System.IO.StreamWriter(filename, True)
  20. objwriter.WriteLine(lineoftext)
  21.  
  22. objwriter.Close()
  23.  
  24. MsgBox("Record Saved To Notepad")
  25.  
  26. End Sub
Million thanks
Last edited by Narue; Jan 5th, 2009 at 9:30 am. Reason: added code tags
Reply With Quote