Value cannot be null. Parameter name: stream

Posted on 2006-03-24
Medium Priority
Last Modified: 2007-11-27
Value cannot be null.
Parameter name: stream

I'm not sure how to resolve this.  I have referenced filefs but before this was working fine:

            Dim file As New IO.FileInfo(sIncomingfile)
            Dim filefs As IO.FileStream = Nothing
            Dim reader As New IO.StreamReader(filefs)  <-------- Problem is that it doesn't like Nothing
Question by:dba123
  • 2
LVL 21

Accepted Solution

mastoo earned 2000 total points
ID: 16284449
There's no constructor that takes a filestream.  Maybe something like this:

Dim file As New IO.FileInfo(sIncomingfile)
Dim reader As IO.StreamReader = file.OpenText()

Author Comment

ID: 16284512
I got it, I must have changed something...

            Dim file As New IO.FileInfo(sIncomingfile)
            Dim filefs As New IO.FileStream(file.FullName, IO.FileMode.Open)

Author Comment

ID: 16284516
your version also worked so I'll reward the points.  Thanks!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question