I want to store a string variable value into binary variable (Varbinary datatype).
I am using UiPath.system.activities= 21.10.3
UiPath.uiautomation.activities= 22.4.4
Studio version 2020.10.3
I can’t downgrade the package version.
I want to store a string variable value into binary variable (Varbinary datatype).
I am using UiPath.system.activities= 21.10.3
UiPath.uiautomation.activities= 22.4.4
Studio version 2020.10.3
I can’t downgrade the package version.
Hi @BNK
Have you tried like this?
binaryValue, of type Byte[] to store the binary representation.Assign activity: stringValue = "Hello World!"
Assign activity: binaryValue = System.Text.Encoding.ASCII.GetBytes(stringValue)
Regards
Gokul
Hi @BNK
Have you tried like this for Varbinary datatype?
Create a variable, let’s say binaryValue, of type System.Data.SqlTypes.SqlBytes.
Convert the string value to a byte array using the System.Text.Encoding.Default.GetBytes() method.
Assign activity: stringValue = "Hello World!"
Assign activity: binaryValue = New System.Data.SqlTypes.SqlBytes(System.Text.Encoding.Default.GetBytes(stringValue))