This is a short how-to convert a string to byte-array without any encoding (byte-by-byte) in SQL Server Integration Services (SSIS).
I would like to save this string “I love you” as BLOB. Let’s assume our Output column name is fileContent.
Row.filecontent.AddBlobData(GetBytes("I love you"));
AND
byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
Reference
Add to favorites