I had a file called TEST.TXT (ANSI) that contained TEST on three lines.  I 
streamed it into the Binary table and sure enough  the readerfunctions threw 
exceptions telling me to check if I've reached the end of the file.
   
  However, this might be a hack - I'm not sure, I was able to work around it 
like this:
   
  Stream s= rec["Data"] as Stream;
  BinaryReader br = new BinaryReader(s, Encoding.ASCII );
  StringBuilder sb = new StringBuilder();
  for( int i=0; i<s.Length; i++)
  {
  sb.Append( br.ReadChar());
  }
  MessageBox.Show( sb.ToString() );
   
   
  

Jason Ginchereau <[EMAIL PROTECTED]> wrote:
                Maybe an obvious question, but is the "Data" field of that 
Record null? Check binRec.IsNull("Data"), or check for a null return from 
binRec.GetStream("Data").
   
  If the field is null and you don't expect it to be, please share a little 
more of your code.
   
  -Jason-
   
    From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher 
Karper
Sent: Wednesday, May 21, 2008 11:07 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] DTF Stream Operations Issue

   
  I'm trying to read binary data into a memory stream, but 

    Stream stream = binRec.GetStream("Data");
    using (StreamReader sr = new StreamReader(stream))
    {
        script += sr.ReadToEnd();
    }



Gives me an ArgumentNullException when I try to read the stream.   Am I missing 
a step?


Is this stream not compatible with a streamreader?

Chris

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


       
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to