public static string BytesToLiteral(object value) { Util.CheckParam(value, nameof(value)); var str = "0x" + HexUtil.ByteArrayToHex(DbDriverUtil.GetBytes(value)); return(str); }
public static string BytesToLiteral(object value) { Util.CheckParam(value, nameof(value)); byte[] bytes = DbDriverUtil.GetBytes(value); Util.Check(bytes != null, "Bytes to literal: invalid input value type {0}", value.GetType()); return("x'" + HexUtil.ByteArrayToHex(bytes) + "'"); }
public static string BytesToLiteral(object value) { if (value == null || value == DBNull.Value) { return(SqlTerms.Null.Text); } byte[] bytes = DbDriverUtil.GetBytes(value); Util.Check(bytes != null, "Bytes to literal: invalid input value type {0}", value.GetType()); return("hextoraw('" + HexUtil.ByteArrayToHex(bytes) + "')"); }
private static string BytesToLiteral(object value) { if (value == null || value == DBNull.Value) { return("NULL"); } var bytes = DbDriverUtil.GetBytes(value); return(@"E'\\x" + HexUtil.ByteArrayToHex(bytes) + "'"); }