student name and grade in file

Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2007
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

 
0
  #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 "
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
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

 
1
  #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 4:52 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
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

 
0
  #3
Dec 2nd, 2008
cool thank you, I forgot about concatenation
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC