elianeasmar
Well-known member
- Joined
- Oct 3, 2013
- Messages
- 76
- Programming Experience
- Beginner
Hello Experts.
I need your help in something. it got a bit hard for me, since i am a beginner.
i have a collection. (Please don't ask me why i'm using a collection :/) , it's an assignment.
--------------------------------------------------------------------------------
Dim _collection As Collection
Dim _icollection As IList(Of _schoolinfo)
Dim _inf As New _schoolinfo
Dim _info As _schoolinfo
and this is my sructure:
-----------------------
Public Structure _schoolinfo
Public Code As String
Public Name As String
Public PhoneNumber As String
Public Address As String
Public Sex As String
Public Title As String
Public Position As String
Public DateTime As DateTime
End Structure
--------------------------------
and i have these two functions.
-------------------------------
Public Sub btnNotepad_Click(sender As Object, e As EventArgs) Handles btnNotepad.Click
Using myWriter As New StreamWriter("C:\Users\ELIANE\Desktop\Exported-to-Notepad.txt", True)
myWriter.WriteLine("{0},{1},{2},{3},{4},{5}", txtCode.Text, cmbTitle.Text, txtName.Text, cmbPosition.Text, txtAddress.Text, txtPhoneNumber.Text)
End Using
End Sub
Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click
Using myWriter As New StreamWriter("C:\Users\ELIANE\Desktop\Exported-to-Exel.csv", True)
myWriter.Write("{0},{1},{2},{3},{4},{5}", txtCode.Text, cmbTitle.Text, txtName.Text, cmbPosition.Text, txtAddress.Text, txtPhoneNumber.Text)
End Using
End Sub
what i need is to import the collection to the new form that i am using to export what's in it. because the two functions above just export the record displayed in the textboxes.
and i need to combine the two functions in Only One.
and for that i need to apply
for each _inf in collection
.
.
.
Next
I apreciate any help. Thank you
I need your help in something. it got a bit hard for me, since i am a beginner.
i have a collection. (Please don't ask me why i'm using a collection :/) , it's an assignment.
--------------------------------------------------------------------------------
Dim _collection As Collection
Dim _icollection As IList(Of _schoolinfo)
Dim _inf As New _schoolinfo
Dim _info As _schoolinfo
and this is my sructure:
-----------------------
Public Structure _schoolinfo
Public Code As String
Public Name As String
Public PhoneNumber As String
Public Address As String
Public Sex As String
Public Title As String
Public Position As String
Public DateTime As DateTime
End Structure
--------------------------------
and i have these two functions.
-------------------------------
Public Sub btnNotepad_Click(sender As Object, e As EventArgs) Handles btnNotepad.Click
Using myWriter As New StreamWriter("C:\Users\ELIANE\Desktop\Exported-to-Notepad.txt", True)
myWriter.WriteLine("{0},{1},{2},{3},{4},{5}", txtCode.Text, cmbTitle.Text, txtName.Text, cmbPosition.Text, txtAddress.Text, txtPhoneNumber.Text)
End Using
End Sub
Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click
Using myWriter As New StreamWriter("C:\Users\ELIANE\Desktop\Exported-to-Exel.csv", True)
myWriter.Write("{0},{1},{2},{3},{4},{5}", txtCode.Text, cmbTitle.Text, txtName.Text, cmbPosition.Text, txtAddress.Text, txtPhoneNumber.Text)
End Using
End Sub
what i need is to import the collection to the new form that i am using to export what's in it. because the two functions above just export the record displayed in the textboxes.
and i need to combine the two functions in Only One.
and for that i need to apply
for each _inf in collection
.
.
.
Next
I apreciate any help. Thank you