tags:

views:

47

answers:

2
Dim line As String
Using readFile As New StreamReader(SalesUpdateFile)

While (line = readFile.ReadLine) IsNot Nothing

i am new to vb and everytime i run this code it gives me this error "IS" requires an operand that have a refrence type any help will be highly apperciated thnx

+3  A: 

You can't use an assignment as an expression in VB. Instead you should do something similar to this:

line = readFile.ReadLine
While (line IsNot Nothing)
    'process the line
     line = readFile.ReadLine
End While
Konamiman
+1  A: 

The while loop you have in your code is an idiom specific to C#. Take a look at this example on MSDN for the VB.Net equivelent:

http://msdn.microsoft.com/en-us/library/system.io.streamreader%28loband%29.aspx

rob
Yeah, I always forget that VB has do - loop until.
Konamiman