Click here to Skip to main content
15,915,864 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: ADODC control and SQL query Pin
MalikRizwan31-Oct-05 21:10
MalikRizwan31-Oct-05 21:10 
QuestionPrinting a Form in VB.net Like Access 2000 Pin
Rich Locus30-Oct-05 15:24
Rich Locus30-Oct-05 15:24 
AnswerRe: Printing a Form in VB.net Like Access 2000 Pin
Rich Locus30-Oct-05 15:42
Rich Locus30-Oct-05 15:42 
AnswerRe: Printing a Form in VB.net Like Access 2000 Pin
Christian Graus30-Oct-05 16:01
protectorChristian Graus30-Oct-05 16:01 
QuestionInvalidate and Flicker Pin
rwestgraham30-Oct-05 13:51
rwestgraham30-Oct-05 13:51 
AnswerRe: Invalidate and Flicker Pin
Christian Graus30-Oct-05 14:39
protectorChristian Graus30-Oct-05 14:39 
GeneralRe: Invalidate and Flicker Pin
rwestgraham30-Oct-05 16:22
rwestgraham30-Oct-05 16:22 
QuestionRead From Text File Pin
kenexcelon30-Oct-05 11:23
kenexcelon30-Oct-05 11:23 
I have to read from a text file, but I can't get all of the fields out. As you can probably see, there is no real delimiter. Someone please help me.

1 ANSARI, EHSAN B 111-11-111 BT SR CSCI P Enrolled
2 CRAWFORD, BRIAN KEITH 111-11-111 BT SR CSCI P Enrolled
3 ELLIS, RICHARD M 111-11-111 BT SR CSCI P Enrolled
4 GARDNER, JAMES ROBY 111-11-111 BT SR CSCI P Enrolled
5 GNAU, DANIEL C 111-11-111 BT SR CSCI A Enrolled
7 GOULDER, JEFFREY SCOTT 111-11-111 BT SR CSCI P Enrolled
8 LAWSON, BRANDI NICOLE 111-11-111 BT SR CSCI P Enrolled
9 MONROE, JENNIFER M 111-11-111 BT SR CSCI P Enrolled
10 MOORE, MELISSA ANN 111-11-111 BT SR CSCI P Enrolled
11 OVERHOLT, JAMES PATRIC 111-11-111 BT SR CSCI P Enrolled
12 PARKER, BRIAN DOUGLAS 111-11-111 BT SR CSCI P Enrolled

I've got some code and it loops through all rows, but how can I get all of the "columns" extracted?

Here's my code:

Public Sub LoadStudents(ByVal strFile As String)
Dim fs As New FileStream(strFile, FileMode.Open)
Dim sr As StreamReader
Try
sr = New StreamReader(fs)
Dim str As String
Dim ar As String()
Do While sr.Peek <> -1
str = sr.ReadLine
If str.Trim.Length <> 0 Then
ar = str.Split(CChar(" "))
stud = New Student
With stud
.Number = CType(ar(0), Integer)
'.Last = CType(ar(1), String).Substring(0, .Last.Length - 1)
'Fix above parsing error
.Last = CType(ar(1), String)
.First = CType(ar(2), String)
.MidI = CType(ar(3), String)
.ID = CType(ar(4), String)
.College = CType(ar(5), String)
.Classification = CType(ar(6), String)
.Email = CType(ar(7), String)
.Major = CType(ar(8), String)
.Paid = CType(ar(9), String)
.Enrolled = CType(ar(10), String)
End With
End If
Loop
Catch ex As Exception
Exception(ex)
Finally
fs.Close()
sr.Close()
End Try
End Sub
AnswerRe: Read From Text File Pin
kenexcelon30-Oct-05 11:27
kenexcelon30-Oct-05 11:27 
AnswerRe: Read From Text File Pin
Steve Pullan30-Oct-05 12:30
Steve Pullan30-Oct-05 12:30 
GeneralRe: Read From Text File Pin
kenexcelon31-Oct-05 4:14
kenexcelon31-Oct-05 4:14 
GeneralRe: Read From Text File Pin
Steve Pullan31-Oct-05 13:37
Steve Pullan31-Oct-05 13:37 
Questionwhat control does Word use for its texteditor? (like advanced rich textbox?) Pin
HeroRaven29-Oct-05 19:05
HeroRaven29-Oct-05 19:05 
AnswerRe: what control does Word use for its texteditor? (like advanced rich textbox?) Pin
Colin Angus Mackay30-Oct-05 5:06
Colin Angus Mackay30-Oct-05 5:06 
AnswerRe: what control does Word use for its texteditor? (like advanced rich textbox?) Pin
Moonark30-Oct-05 10:28
Moonark30-Oct-05 10:28 
AnswerRe: what control does Word use for its texteditor? (like advanced rich textbox?) Pin
toxcct31-Oct-05 0:34
toxcct31-Oct-05 0:34 
AnswerRe: what control does Word use for its texteditor? (like advanced rich textbox?) Pin
cynferdd31-Oct-05 0:37
cynferdd31-Oct-05 0:37 
GeneralRe: what control does Word use for its texteditor? (like advanced rich textbox?) Pin
HeroRaven31-Oct-05 12:46
HeroRaven31-Oct-05 12:46 
QuestionVB.net and Access dB Pin
JMS7629-Oct-05 14:44
JMS7629-Oct-05 14:44 
AnswerRe: VB.net and Access dB Pin
KaptinKrunch31-Oct-05 2:07
KaptinKrunch31-Oct-05 2:07 
QuestionPassing Data between different web sites Pin
john_paul29-Oct-05 11:48
john_paul29-Oct-05 11:48 
AnswerRe: Passing Data between different web sites Pin
John Kuhn30-Oct-05 10:05
John Kuhn30-Oct-05 10:05 
GeneralRe: Passing Data between different web sites Pin
john_paul30-Oct-05 14:13
john_paul30-Oct-05 14:13 
QuestionHow to get the code of .exe file Pin
maheshreddy_iiith29-Oct-05 10:49
maheshreddy_iiith29-Oct-05 10:49 
AnswerRe: How to get the code of .exe file Pin
rwestgraham29-Oct-05 11:27
rwestgraham29-Oct-05 11:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.