RSS Forums RSS

student name and grade in file

Please support our VB.NET advertiser: DiscountASP.NET – 3 Months Free on VB.NET Web Hosting
Thread Solved
Reply
Posts: 58
Reputation: bpacheco1227 is an unknown quantity at this point 
Solved Threads: 0
bpacheco1227 bpacheco1227 is offline Offline
Junior Poster in Training

student name and grade in file

  #1  
Dec 1st, 2008
I need to add student name and grade to a file.
This is my section of code so far
  1. Private Sub addStudentNameGrade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addStudentNameGrade.Click
  2. Dim swrStreamWriter As IO.StreamWriter
  3. swrStreamWriter = IO.File.AppendText(path & "studentgrade.txt")
  4. swrStreamWriter.WriteLine(Me.textStudent.Text, " ", Me.textGrade.Text)
  5. 'swrStreamWriter.WriteLine(Me.textGrade.Text)
  6. swrStreamWriter.Close()
  7. End Sub

I know the problem is with this line " swrStreamWriter.WriteLine(Me.textStudent.Text, " ", Me.textGrade.Text) " . I'm not sure how to show in the file "textStudent textGrade". Need to write, in a file student then grade on the same line, eg. " Brandon 70 "
AddThis Social Bookmark Button
Reply With Quote  
Posts: 10
Reputation: markd220 is an unknown quantity at this point 
Solved Threads: 2
markd220 markd220 is offline Offline
Newbie Poster

Re: student name and grade in file

  #2  
Dec 1st, 2008
You want to make both texts one string and write that to the file.

swrStreamWriter.WriteLine(Me.textStudent.Text + " " + Me.textGrade.Text)

Also research the VB.Net String Functions for further reading.
Last edited by markd220 : Dec 1st, 2008 at 3:52 pm.
Reply With Quote  
Posts: 58
Reputation: bpacheco1227 is an unknown quantity at this point 
Solved Threads: 0
bpacheco1227 bpacheco1227 is offline Offline
Junior Poster in Training

Re: student name and grade in file

  #3  
Dec 2nd, 2008
cool thank you, I forgot about concatenation
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Views: 272 | Replies: 2 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:05 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC