Click here to Skip to main content
16,006,605 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: change value of dropdown box Pin
Johan Hakkesteegt8-Sep-09 21:11
Johan Hakkesteegt8-Sep-09 21:11 
GeneralRe: change value of dropdown box Pin
dodg3r78-Sep-09 22:14
dodg3r78-Sep-09 22:14 
GeneralRe: change value of dropdown box Pin
Christian Graus8-Sep-09 22:28
protectorChristian Graus8-Sep-09 22:28 
GeneralRe: change value of dropdown box Pin
dodg3r79-Sep-09 3:07
dodg3r79-Sep-09 3:07 
GeneralRe: change value of dropdown box Pin
Johan Hakkesteegt8-Sep-09 22:40
Johan Hakkesteegt8-Sep-09 22:40 
GeneralRe: change value of dropdown box Pin
dodg3r79-Sep-09 3:08
dodg3r79-Sep-09 3:08 
GeneralRe: change value of dropdown box Pin
warfdpn17-Sep-09 9:38
warfdpn17-Sep-09 9:38 
Question[solved] ObjectDisposedException - Cannot access a closed file Pin
nathan_i8-Sep-09 9:05
nathan_i8-Sep-09 9:05 
I get this error and I'm not sure why. I am trying to parse a tab seperated file. The first 10 lines parse correctly and on the 11th it throws the above error. Always on the 11th line and I've tried several different files of varying length and content. I am not closing or disposing the StreamReader before the file is read out entirely. Below is my reading function:

Public Function readNextLine(ByRef buffer As Single()) As Boolean
   Dim i As Integer
   Dim tempString As String()

   tempString = Split(fStreamReader.ReadLine(), cDelim)

   ReDim buffer(tempString.Length - 2)
   For i = 0 To tempString.Length - 2
      If (IsNumeric(tempString(i))) Then
         buffer(i) = CSng(tempString(i))
      Else
         buffer(i) = 0
      End If
   Next
   readNextLine = True
End Function


The above function is called in the following while loop:

Private Sub file_to_dataset(ByVal fileInfo As System.IO.FileInfo)
   Dim singleRead As Single() = {0}

   fileParser = New clsFileParser(fileInfo, vbTab)

   dsLogData.Clear()

   While fileParser.peek() <> -1
      If (fileParser.readNextLine(singleRead)) Then
         If (singleRead.Length = dsLogData.Columns.Count) Then
            dsLogData.Rows.Add(singleRead)
         End If
      End If
   End While
End Sub


I've tried changing the buffer size on the streamReader, but it seems to have no effect.

modified on Tuesday, September 8, 2009 4:47 PM

AnswerRe: ObjectDisposedException - Cannot access a closed file Pin
nathan_i8-Sep-09 10:47
nathan_i8-Sep-09 10:47 
Questionnested if statement Pin
malcomhfc8-Sep-09 8:38
malcomhfc8-Sep-09 8:38 
AnswerRe: nested if statement Pin
EliottA8-Sep-09 8:44
EliottA8-Sep-09 8:44 
GeneralRe: nested if statement Pin
malcomhfc8-Sep-09 9:05
malcomhfc8-Sep-09 9:05 
GeneralRe: nested if statement Pin
Luc Pattyn8-Sep-09 14:15
sitebuilderLuc Pattyn8-Sep-09 14:15 
QuestionVb.net Break Down Number HELP Pin
PAguilar098-Sep-09 1:48
PAguilar098-Sep-09 1:48 
AnswerRe: Vb.net Break Down Number HELP Pin
Jay Royall8-Sep-09 2:00
Jay Royall8-Sep-09 2:00 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 2:39
PAguilar098-Sep-09 2:39 
GeneralRe: Vb.net Break Down Number HELP Pin
Jay Royall8-Sep-09 4:30
Jay Royall8-Sep-09 4:30 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 11:16
PAguilar098-Sep-09 11:16 
GeneralRe: Vb.net Break Down Number HELP Pin
helelark1238-Sep-09 8:48
helelark1238-Sep-09 8:48 
AnswerRe: Vb.net Break Down Number HELP Pin
helelark1238-Sep-09 2:03
helelark1238-Sep-09 2:03 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 2:36
PAguilar098-Sep-09 2:36 
AnswerRe: Vb.net Break Down Number HELP Pin
Johan Hakkesteegt8-Sep-09 3:21
Johan Hakkesteegt8-Sep-09 3:21 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 10:41
PAguilar098-Sep-09 10:41 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 11:15
PAguilar098-Sep-09 11:15 
GeneralRe: Vb.net Break Down Number HELP Pin
PAguilar098-Sep-09 19:58
PAguilar098-Sep-09 19:58 

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.