HOME > .NET Framework > Forum > System.InvalidCastException: Failed to convert parameter value from a String to a Byte[]. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Byte[]'.
System.InvalidCastException: Failed to convert parameter value from a String to a Byte[]. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Byte[]'.
System.InvalidCastException: Failed to convert parameter value from a String to a Byte[]. ---> System.InvalidCastException: Invalid cast from 'System.String' to 'System.Byte[]'.
Code (VB.NET)
With objCmd
.Parameters.Add("@Name", SqlDbType.Binary).Value = strName
End With