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


C# SqlChars.Read方法代码示例

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


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

示例1: Read_NullBufferAndInstanceValueTest

		public void Read_NullBufferAndInstanceValueTest ()
		{
			char [] c2 = null;
			SqlChars chars = new SqlChars ();
			
			chars.Read (0, c2, 8, 4);
		}
开发者ID:LevNNN,项目名称:mono,代码行数:7,代码来源:SqlCharsTest.cs

示例2: Read_NegativeCountTest

		public void Read_NegativeCountTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = new char [5];
			
			chars.Read (0, c2, 0, -1);
			Assert.Fail ("#11 Should throw ArgumentOutOfRangeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例3: Read_NullInstanceValueTest

		public void Read_NullInstanceValueTest ()
		{
			char [] c2 = new char [5];
			SqlChars chars = new SqlChars ();
			
			chars.Read (0, c2, 8, 4);
			Assert.Fail ("#7 Should throw SqlNullValueException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:8,代码来源:SqlCharsTest.cs

示例4: Read_SuccessTest2

		public void Read_SuccessTest2 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = new char [10];
			
			chars.Read (5, c2, 0, 10);
			Assert.AreEqual (chars.Value [5], c2 [0], "#8 Should be same");
			Assert.AreEqual (chars.Value [9], c2 [4], "#9 Should be same");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:10,代码来源:SqlCharsTest.cs

示例5: Read_NullBufferTest

		public void Read_NullBufferTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = null;
			
			chars.Read (0, c2, 0, 10);
			Assert.Fail ("#2 Should throw ArgumentNullException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例6: Read_InvalidOffsetInBufferTest

		public void Read_InvalidOffsetInBufferTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = new char [5];

			chars.Read (0, c2, 8, 4);
			Assert.Fail ("#6 Should throw ArgumentOutOfRangeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例7: SetSqlChars_Unchecked

 private static void SetSqlChars_Unchecked(SmiEventSink_Default sink, ITypedSettersV3 setters, int ordinal, SqlChars value, int offset, int length)
 {
     if (value.IsNull)
     {
         setters.SetDBNull(sink, ordinal);
         sink.ProcessMessagesAndThrow();
     }
     else
     {
         int num4;
         long num5;
         if ((length > 0xfa0) || (length < 0))
         {
             num4 = 0xfa0;
         }
         else
         {
             num4 = length;
         }
         char[] buffer = new char[num4];
         long num2 = 1L;
         long num = offset;
         for (long i = 0L; ((length < 0) || (i < length)) && ((0L != (num5 = value.Read(num, buffer, 0, num4))) && (0L != num2)); i += num2)
         {
             num2 = setters.SetChars(sink, ordinal, num, buffer, 0, (int) num5);
             sink.ProcessMessagesAndThrow();
             num += num2;
         }
         setters.SetCharsLength(sink, ordinal, num);
         sink.ProcessMessagesAndThrow();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:ValueUtilsSmi.cs

示例8: Read_NegativeOffsetInBufferTest

		public void Read_NegativeOffsetInBufferTest ()
		{
            ExceptionAssert.Throws<ArgumentOutOfRangeException>(
		        delegate
		            {
		                char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
		                SqlChars chars = new SqlChars (c1);
		                char [] c2 = new char [5];
			
		                chars.Read (0, c2, -1, 4);
		                Assert.Fail ("#5 Should throw ArgumentOutOfRangeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlCharsTest.cs

示例9: Read_NullBufferAndInstanceValueTest

        public void Read_NullBufferAndInstanceValueTest()
        {
            char[] c2 = null;
            SqlChars chars = new SqlChars();

            Assert.Throws<SqlNullValueException>(() => chars.Read(0, c2, 8, 4));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:SqlCharsTest.cs

示例10: Read_InvalidCountTest2

        public void Read_InvalidCountTest2()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            SqlChars chars = new SqlChars(c1);
            char[] c2 = new char[5];

            Assert.Throws<ArgumentOutOfRangeException>(() => chars.Read(0, c2, 3, 4));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlCharsTest.cs

示例11: Read_NegativeOffsetInBufferTest

        public void Read_NegativeOffsetInBufferTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            SqlChars chars = new SqlChars(c1);
            char[] c2 = new char[5];

            Assert.Throws<ArgumentOutOfRangeException>(() => chars.Read(0, c2, -1, 4));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlCharsTest.cs

示例12: Read_NullBufferTest

        public void Read_NullBufferTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            SqlChars chars = new SqlChars(c1);
            char[] c2 = null;

            Assert.Throws<ArgumentNullException>(() => chars.Read(0, c2, 0, 10));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlCharsTest.cs

示例13: Read_NullBufferAndInstanceValueTest

		public void Read_NullBufferAndInstanceValueTest ()
		{
			char [] c2 = null;
			SqlChars chars = new SqlChars ();
			
			chars.Read (0, c2, 8, 4);
			Assert.Fail ("#10 Should throw ArgumentNullException");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:SqlCharsTest.cs

示例14: Read_InvalidCountTest2

		public void Read_InvalidCountTest2 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = new char [5]; 

			chars.Read (0, c2, 3, 4);
			Assert.Fail ("#12 Should throw ArgumentOutOfRangeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例15: Read_SuccessTest1

		public void Read_SuccessTest1 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars (c1);
			char [] c2 = new char [10];

			chars.Read (0, c2, 0, (int) chars.Length);
			Assert.AreEqual (chars.Value [5], c2 [5], "#1 Should be equal");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs


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