Here are the examples of the csharp api class System.Data.Common.ADP.LiteralValueIsInvalid(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Example
0
1. Example
View licensestatic internal byte[] ByteArrayFromString(string hexString, string dataTypeName) { if ((hexString.Length & 0x1) != 0) { throw ADP.LiteralValueIsInvalid(dataTypeName); } char[] c = hexString.ToCharArray(); byte[] b = new byte[hexString.Length / 2]; CultureInfo invariant = CultureInfo.InvariantCulture; for (int i = 0; i < hexString.Length; i += 2) { int h = hexDigits.IndexOf(Char.ToLower(c[i], invariant)); int l = hexDigits.IndexOf(Char.ToLower(c[i+1], invariant)); if (h < 0 || l < 0) { throw ADP.LiteralValueIsInvalid(dataTypeName); } b[i/2] = (byte)((h << 4) | l); } return b; }