当前位置: 首页>>代码示例>>C#>>正文


C# SqlTypes.SqlBinary类代码示例

本文整理汇总了C#中System.Data.SqlTypes.SqlBinary的典型用法代码示例。如果您正苦于以下问题:C# SqlBinary类的具体用法?C# SqlBinary怎么用?C# SqlBinary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SqlBinary类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlBinary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetCapacity

 override public void SetCapacity(int capacity) {
     SqlBinary[] newValues = new SqlBinary[capacity];
     if (null != values) {
         Array.Copy(values, 0, newValues, 0, Math.Min(capacity, values.Length));
     }
     values = newValues;
 }
开发者ID:uQr,项目名称:referencesource,代码行数:7,代码来源:SQLBinaryStorage.cs

示例2: ComputeMD5AsBase64

        public static SqlString ComputeMD5AsBase64(SqlBinary byteArray)
        {
            if (byteArray.IsNull)
                return SqlString.Null;

            System.Security.Cryptography.MD5 sscMD5 = System.Security.Cryptography.MD5.Create();
            byte[] mHash = sscMD5.ComputeHash(byteArray.Value);
            return Convert.ToBase64String(mHash);
        }
开发者ID:DomG4,项目名称:sqlservertoazure,代码行数:9,代码来源:Utils.cs

示例3: AAM

 public static SqlString AAM(SqlBinary reaction, SqlString options, SqlString bingo_schema)
 {
     using (SqlConnection conn = new SqlConnection("context connection=true"))
      {
     conn.Open();
     prepareContext(conn, bingo_schema.Value, 0, 0);
      }
      return new SqlString(BingoCore.ringoAAM(reaction.Value, options.Value));
 }
开发者ID:harcharansidhu,项目名称:indigo,代码行数:9,代码来源:Bingo.cs

示例4: ExtractString

		public static SqlString ExtractString(SqlBinary binary)
		{
			using (var decompressed = new MemoryStream(binary.Value))
			{
				using (var stream = ExtractStream(decompressed))
				{
					return MemoryStreamToString(stream as MemoryStream, Encoding.UTF8);
				}
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:10,代码来源:CompressManager.Extract.cs

示例5: AAM

 public static SqlString AAM(SqlBinary reaction, SqlString options, SqlString bingo_schema)
 {
     ContextFlags flags = ContextFlags.X_PSEUDO | ContextFlags.IGNORE_CBDM;
      using (SqlConnection conn = new SqlConnection("context connection=true"))
      {
     conn.Open();
     prepareContext(conn, bingo_schema.Value, 0, flags);
      }
      return new SqlString(BingoCore.ringoAAM(reaction.Value, options.Value));
 }
开发者ID:metamolecular,项目名称:indigo,代码行数:10,代码来源:Bingo.cs

示例6: ConvertXmlToObject

 public override object ConvertXmlToObject(string s)
 {
     SqlBinary binary = new SqlBinary();
     StringReader input = new StringReader("<col>" + s + "</col>");
     IXmlSerializable serializable = binary;
     using (XmlTextReader reader = new XmlTextReader(input))
     {
         serializable.ReadXml(reader);
     }
     return new SqlBytes((SqlBinary) serializable);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:11,代码来源:SqlBytesStorage.cs

示例7: AddInParameterExactSized

 internal static SqlParameter AddInParameterExactSized(this SqlCommand cmd, string name, SqlBinary value)
 {
     var prm = cmd.CreateParameter();
     prm.Direction = ParameterDirection.Input;
     prm.ParameterName = name;
     prm.SqlDbType = SqlDbType.Binary;
     prm.SqlValue = value;
     prm.Size = value.Length;
     cmd.Parameters.Add(prm);
     return prm;
 }
开发者ID:JamesDunne,项目名称:Immutable-Versioned-Objects,代码行数:11,代码来源:Helpers.cs

示例8: SqlBytes

		public SqlBytes (SqlBinary value)
		{
			if (value.IsNull) {
				notNull = false;
				buffer = null;
			}
			else {
				notNull = true;
				buffer = value.Value;
				storage = StorageState.Buffer;
			}
		}
开发者ID:nlhepler,项目名称:mono,代码行数:12,代码来源:SqlBytes.cs

示例9: CanSmiles

        public static SqlString CanSmiles(SqlBinary molecule, SqlString bingo_schema)
        {
            using (BingoSession session = new BingoSession())
             {
            using (SqlConnection conn = new SqlConnection("context connection=true"))
            {
               conn.Open();
               prepareContext(conn, bingo_schema.Value, 0, 0);
            }

            return BingoCore.mangoSMILES(molecule.Value, true);
             }
        }
开发者ID:harcharansidhu,项目名称:indigo,代码行数:13,代码来源:Bingo.cs

示例10: ExtractStringWithEncoding

		public static SqlString ExtractStringWithEncoding(SqlBinary binary, string encodingName)
		{
			using (var decompressed = new MemoryStream(binary.Value))
			{
				using (var stream = ExtractStream(decompressed))
				{
					if (encodingName == string.Empty || encodingName == null)
						encodingName = "utf-8";

					return MemoryStreamToString(stream as MemoryStream, Encoding.GetEncoding(encodingName));
				}
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:13,代码来源:CompressManager.Extract.cs

示例11: GetReady

		public void GetReady() 
		{
                        byte [] b1 = new Byte [2];
                        byte [] b2 = new Byte [3];
                        byte [] b3 = new Byte [2];

			b1 [0] = 240;
			b1 [1] = 15;
			b2 [0] = 10;
			b2 [1] = 10;
			b2 [2] = 10;
			b3 [0] = 240;
			b3 [1] = 15;

			Test1 = new SqlBinary(b1);
			Test2 = new SqlBinary(b2);
			Test3 = new SqlBinary(b3);
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:18,代码来源:SqlBinaryTest.cs

示例12: SqlBinaryTest

        public SqlBinaryTest()
        {
            byte[] b1 = new byte[2];
            byte[] b2 = new byte[3];
            byte[] b3 = new byte[2];

            b1[0] = 240;
            b1[1] = 15;
            b2[0] = 10;
            b2[1] = 10;
            b2[2] = 10;
            b3[0] = 240;
            b3[1] = 15;

            _test1 = new SqlBinary(b1);
            _test2 = new SqlBinary(b2);
            _test3 = new SqlBinary(b3);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:18,代码来源:SqlBinaryTest.cs

示例13: _Match

      private static SqlInt32 _Match (SqlBinary target, SqlString query, SqlString options,
         SqlString bingo_schema, string search_type,
         bingoCallback prepare_match, bingoCallback process_matched)
      {
         using (BingoSession sessions = new BingoSession())
         {
            ContextFlags flags = 0;

            if (options.Value.Contains("TAU"))
               flags |= ContextFlags.TAU_RULES;
            if (search_type == "SIM")
               flags |= ContextFlags.FINGERPRINTS;

            using (SqlConnection conn = new SqlConnection("context connection=true"))
            {
               conn.Open();
               prepareContext(conn, bingo_schema.Value, 0, flags);
            }

            int res = BingoCore.lib.mangoSetupMatch(search_type, query.Value, options.Value);
            if (res < 0)
               throw new Exception(BingoCore.lib.bingoGetError());

            if (prepare_match != null)
               prepare_match();

            res = BingoCore.lib.mangoMatchTarget(target.Value, target.Value.Length);
            if (res == -2)
               throw new Exception(BingoCore.lib.bingoGetError());

            if (res == -1)
            {
               // can not use SqlContext.Pipe from inside the function, 
               // so just returning NULL without printing the error message
               return SqlInt32.Null;
            }

            if (res == 1 && process_matched != null)
               process_matched();

            return new SqlInt32(res);
         }
      }
开发者ID:whztt07,项目名称:Indigo,代码行数:43,代码来源:Bingo.cs

示例14: Exact

 public static SqlInt32 Exact (SqlBinary target, SqlString query, SqlString options, SqlString bingo_schema)
 {
    return _Match(target, query, options, bingo_schema, "EXACT", null, null);
 }
开发者ID:whztt07,项目名称:Indigo,代码行数:4,代码来源:Bingo.cs

示例15: SMARTS

 public static SqlInt32 SMARTS (SqlBinary target, SqlString query, SqlString options, SqlString bingo_schema)
 {
    return _Match(target, query, options, bingo_schema, "SMARTS", null, null);
 }
开发者ID:whztt07,项目名称:Indigo,代码行数:4,代码来源:Bingo.cs


注:本文中的System.Data.SqlTypes.SqlBinary类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。