web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :

Code snippet to convert string to memory stream in Dynamics 365 finance and operations

Jayaprakash Reddy Profile Picture Jayaprakash Reddy 270

Most common scenario to convert string to memory stream in D365FO. Please find the below code for the same.

public static System.IO.Stream JP_generateStreamFromString(str _text)

    {

        System.Byte[]           byteArray;

        System.IO.MemoryStream  memoryStream;



        byteArray    = System.Text.Encoding::UTF8.GetBytes(_text);

        memoryStream = new System.IO.MemoryStream(byteArray);



        return memoryStream;

    }

Hope this helps!, I will come up with another interesting blog post!

Comments

*This post is locked for comments