![Copy image Copy image](copycode.gif)
![CopyHover image CopyHover image](copycodeHighlight.gif)
Deployment Tools Foundation
SetStream Method (field, filePath)
Deployment Tools Foundation Namespaces ► Microsoft.Deployment.WindowsInstaller ► Record ► SetStream(Int32, String)
Sets a record stream field from a file. Stream data cannot be inserted into temporary fields.
![](collapse_all.gif)
C# | Visual Basic | Visual C++ | F# |
public void SetStream( int field, string filePath )
Public Sub SetStream ( field As Integer, filePath As String )
public: void SetStream( int field, String^ filePath )
member SetStream : field : int * filePath : string -> unit
![](collapse_all.gif)
The contents of the specified file are read into a stream object. The stream persists if the Record is inserted into the Database and the Database is committed.
To reset the stream to its beginning you must pass in null for filePath. Do not pass an empty string, "", to reset the stream.
Setting a stream with this method is more efficient than setting a field to a FileStream object.
Win32 MSI API: MsiRecordsetStream
![](collapse_all.gif)
Exception | Condition |
---|---|
ArgumentOutOfRangeException | The field is less than 0 or greater than the
number of fields in the Record. |
Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.11.1.2318)