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


C# SqlTypes.SqlByte类代码示例

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


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

示例1: CreateIPv4

 public static IPv4 CreateIPv4(SqlByte i1, SqlByte i2, SqlByte i3, SqlByte i4)
 {
     IPv4 ip = new IPv4(i1.Value, i2.Value, i3.Value, i4.Value);
     if (ip == null)
         return IPv4.Null;
     else
         return ip;
 }
开发者ID:odelljl,项目名称:sqlproj,代码行数:8,代码来源:IPv4Function.cs

示例2: Properties

        public void Properties()
        {
            SqlByte TestByte = new SqlByte(54);
            SqlByte TestByte2 = new SqlByte(1);

            Assert.True(SqlByte.Null.IsNull);
            Assert.Equal((byte)54, TestByte.Value);
            Assert.Equal((byte)1, TestByte2.Value);
        }
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:SqlByteTest.cs

示例3: Properties

		public void Properties()
		{

			SqlByte TestByte = new SqlByte(54);
			SqlByte TestByte2 = new SqlByte(1);

			Assert.IsTrue (SqlByte.Null.IsNull, "IsNull property" + Error);
			Assert.AreEqual((byte)54, TestByte.Value, "Value property 1" + Error);
			Assert.AreEqual((byte)1, TestByte2.Value, "Value property 2" + Error);

		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs

示例4: Properties

		public void Properties()
		{

			SqlByte TestByte = new SqlByte(54);
			SqlByte TestByte2 = new SqlByte(1);

			Assert("IsNull property" + Error, SqlByte.Null.IsNull);
			AssertEquals("Value property 1" + Error, (byte)54, TestByte.Value);
			AssertEquals("Value property 2" + Error, (byte)1, TestByte2.Value);

		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:SqlByteTest.cs

示例5: Account_AccountBalances_GetRelativeBalance

    public static SqlMoney Account_AccountBalances_GetRelativeBalance(SqlByte b1)
    {
        switch ((int) b1)
          {
               case 1:

               case 2:

               case 3:

               case 4:

               case 5:
                    break;
          }
          // Put your code here
          return new SqlMoney(0m);
    }
开发者ID:weavver,项目名称:data,代码行数:18,代码来源:Accounting_AccountBalances.cs

示例6: AddMethod

        public void AddMethod()
        {
            SqlByte TestByte64 = new SqlByte(64);
            SqlByte TestByte0 = new SqlByte(0);
            SqlByte TestByte164 = new SqlByte(164);
            SqlByte TestByte255 = new SqlByte(255);

            Assert.Equal((byte)64, SqlByte.Add(TestByte64, TestByte0).Value);
            Assert.Equal((byte)228, SqlByte.Add(TestByte64, TestByte164).Value);
            Assert.Equal((byte)164, SqlByte.Add(TestByte0, TestByte164).Value);
            Assert.Equal((byte)255, SqlByte.Add(TestByte255, TestByte0).Value);

            try
            {
                SqlByte.Add(TestByte255, TestByte64);
                Assert.False(true);
            }
            catch (Exception e)
            {
                Assert.Equal(typeof(OverflowException), e.GetType());
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:22,代码来源:SqlByteTest.cs

示例7: DivisionOperator

		public void DivisionOperator()
		{

			SqlByte TestByte2 = new SqlByte(2);
			SqlByte TestByte4 = new SqlByte(4);
			SqlByte TestByte255 = new SqlByte(255);
			SqlByte TestByte0 = new SqlByte(0);

			Assert.AreEqual((SqlByte)2,TestByte4 / TestByte2, "Division operator 1" + Error);
			Assert.AreEqual((SqlByte)127, TestByte255 / TestByte2, "Division operaror 2" + Error);

			try {
				TestByte2 = TestByte255 / TestByte0;
				Assert.Fail("Division operator 3" + Error);
			} catch (Exception e) {
				Assert.AreEqual(typeof(DivideByZeroException), e.GetType(), "DivideByZeroException");
			}

		}
开发者ID:Profit0004,项目名称:mono,代码行数:19,代码来源:SqlByteTest.cs

示例8: BitwiseOrOperator

		public void BitwiseOrOperator()
		{

			SqlByte TestByte2 = new SqlByte(2);
			SqlByte TestByte4 = new SqlByte(4);
			SqlByte TestByte255 = new SqlByte(255);

			Assert.AreEqual((SqlByte)6,TestByte2 | TestByte4, "Bitwise or operator 1" + Error);
			Assert.AreEqual((SqlByte)255, TestByte2 | TestByte255, "Bitwise or operaror 2" + Error);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs

示例9: BitwiseAndOperator

		public void BitwiseAndOperator()
		{

			SqlByte TestByte2 = new SqlByte(2);
			SqlByte TestByte4 = new SqlByte(4);
			SqlByte TestByte255 = new SqlByte(255);

			Assert.AreEqual((SqlByte)0,TestByte2 & TestByte4, "Bitwise and operator 1" + Error);
			Assert.AreEqual((SqlByte)2, TestByte2 & TestByte255, "Bitwise and operaror 2" + Error);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs

示例10: Subtract

		public void Subtract()
		{

			SqlByte TestByte12 = new SqlByte(12);
			SqlByte TestByte128 = new SqlByte(128);
			Assert.AreEqual((byte)116, SqlByte.Subtract(TestByte128, TestByte12).Value, "Subtract method 1" + Error);

			try {
				SqlByte.Subtract(TestByte12, TestByte128);
			} catch(Exception e) {

				Assert.AreEqual(typeof(OverflowException), e.GetType(), "OverflowException");
			}

		}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:SqlByteTest.cs

示例11: SqlByteToByte

		public void SqlByteToByte()
		{
			SqlByte TestByte = new SqlByte(12);
			byte test = (byte)TestByte;
			Assert.AreEqual((byte)12, test, "SqlByteToByte" + Error);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:6,代码来源:SqlByteTest.cs

示例12: OnesComplementOperator

		public void OnesComplementOperator()
		{

			SqlByte TestByte12 = new SqlByte(12);
			SqlByte TestByte128 = new SqlByte(128);

			Assert.AreEqual((SqlByte)243, ~TestByte12, "OnesComplement operator 1" + Error);
			Assert.AreEqual((SqlByte)127, ~TestByte128, "OnesComplement operator 2" + Error);

		}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs

示例13: ThanOrEqualOperators

		public void ThanOrEqualOperators()
		{

			SqlByte TestByte165 = new SqlByte(165);
			SqlByte TestByte100 = new SqlByte(100);
			SqlByte TestByte100II = new SqlByte(100);
			SqlByte TestByte255 = new SqlByte(255);

			Assert.IsTrue ((TestByte165 > TestByte100).Value, "> operator 1" + Error);
			Assert.IsTrue (!(TestByte165 > TestByte255).Value, "> operator 2" + Error);
			Assert.IsTrue (!(TestByte100 > TestByte100II).Value, "> operator 3" + Error);
			Assert.IsTrue (!(TestByte165 >= TestByte255).Value, ">= operator 1" + Error);
			Assert.IsTrue ((TestByte255 >= TestByte165).Value, ">= operator 2" + Error);
			Assert.IsTrue ((TestByte100 >= TestByte100II).Value, ">= operator 3" + Error);

			Assert.IsTrue (!(TestByte165 < TestByte100).Value, "< operator 1" + Error);
			Assert.IsTrue ((TestByte165 < TestByte255).Value, "< operator 2" + Error);
			Assert.IsTrue (!(TestByte100 < TestByte100II).Value, "< operator 3" + Error);
			Assert.IsTrue ((TestByte165 <= TestByte255).Value, "<= operator 1" + Error);
			Assert.IsTrue (!(TestByte255 <= TestByte165).Value, "<= operator 2" + Error);
			Assert.IsTrue ((TestByte100 <= TestByte100II).Value, "<= operator 3" + Error);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:22,代码来源:SqlByteTest.cs

示例14: ToSqlSingle

		public void ToSqlSingle()
		{
	    
			SqlByte TestByte12 = new SqlByte(12);
			SqlByte TestByte0 = new SqlByte(0);
			SqlByte TestByte228 = new SqlByte(228);

			Assert.AreEqual((float)12, TestByte12.ToSqlSingle().Value, "ToSqlSingle method 1" + Error);
			Assert.AreEqual((float)0, TestByte0.ToSqlSingle().Value, "ToSqlSingle method 2" + Error);
			Assert.AreEqual((float)228, TestByte228.ToSqlSingle().Value, "ToSqlSingle method 3" + Error);

		}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:SqlByteTest.cs

示例15: ToSqlMoney

		public void ToSqlMoney()
		{

			SqlByte TestByte12 = new SqlByte(12);
			SqlByte TestByte0 = new SqlByte(0);
			SqlByte TestByte228 = new SqlByte(228);

			Assert.AreEqual(12.0000M, TestByte12.ToSqlMoney().Value, "ToSqMoney method 1" + Error);
			Assert.AreEqual((decimal)0, TestByte0.ToSqlMoney().Value, "ToSqlMoney method 2" + Error);
			Assert.AreEqual(228.0000M, TestByte228.ToSqlMoney().Value, "ToSqlMoney method 3" + Error);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs


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