|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error setting CSV to display textObject reference not set to an instance of an object. pstrfields =
psrdline.Split(pchrDelimiter) What am I missing here? Thanks in advance, Lynn Here is the code:
Dim psrdCurrent As System.IO.StreamReader Dim pintcount As Integer Dim psrdline As String Dim pstrfields() As String Dim filename As String filename = "C:\Documents and Settings\Me\My Documents\Visual Studio Projects\Multicam.csv" psrdCurrent = New System.IO.StreamReader(filename) psrdline = psrdCurrent.ReadLine() Do Until psrdline = Nothing Dim psrdfile As String psrdfile = psrdline & CrLf psrdline = psrdCurrent.ReadLine() Loop Dim pchrDelimiter As Char() = {ToChar(",")} pstrfields = psrdline.Split(pchrDelimiter) pintcount += 1 TextBox3.Text = pstrfields(6) psrdCurrent.Close() You're looping until psrdline is equal to Nothing then trying to access
psrdfile. pstrfields = psrdline.Split(pchrDelimiter) pintcount += 1 TextBox3.Text = pstrfields(6) You may also want to put these lines inside the loop unless it was your intention to split the entire file into one array, then set the TextBox3.Text once. John
Read Emails on Exchange server without OL client
VB2005 timing/speed problem File Names: List Long file Names from Database List of short file names Recursive WebRequest.Create() Call Lisp Program from vb.net help logging events to txt file set focus from treeview to control Invalid format of DLL Compiling internally instead of as a DLL? IDE hangs pinning toolbox so it's open |
|||||||||||||||||||||||