Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,562 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,904 people online right now. Registration is fast and FREE... Join Now!




need to re-write code using stream reader instead of fread

 
Reply to this topicStart new topic

need to re-write code using stream reader instead of fread, need to re-write code

schooler
13 May, 2008 - 06:46 PM
Post #1

New D.I.C Head
*

Joined: 13 May, 2008
Posts: 6

CODE
Dim fread As StreamReader = File.OpenText(Me.txtEnterFileName.Text)


        Dim linein As String = ""
        Dim fname As String = ""
        Dim state As String = ""
        Dim sales As Int32 = 0
        Dim salesPrev As Int32 = 0
          While fread.Peek <> -1

            fname = fread.ReadLine()
             state = fread.ReadLine()
            salesPrev = Convert.ToInt32(fread.ReadLine())
            Console.WriteLine(fname & "  " & state & "   " & sales & "   " & salesPrev)

    Dim num As Int32 = insertIntoDatabase(fname.Trim(), state.Trim(), sales, salesPrev)
            Console.WriteLine(num)
        End While
        fread.Close()

User is offlineProfile CardPM
+Quote Post

Jayman
RE: Need To Re-write Code Using Stream Reader Instead Of Fread
14 May, 2008 - 08:44 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,947



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Moved to VB.NET forum.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 11:39PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month