System.Data.SqlTypes.SqlBytes.SetNull C# (CSharp) Méthode

SetNull() public méthode

public SetNull ( ) : void
Résultat void
        public void SetNull()
        {
            _lCurLen = x_lNull;
            _stream = null;
            _state = SqlBytesCharsState.Null;

            AssertValid();
        }

Usage Example

		public void SqlBytesSetNull ()
		{
			byte [] b1 = new byte [10];
			SqlBytes bytes = new SqlBytes (b1);
			Assert.AreEqual (bytes.Length, 10, "#1 Should be same");
			bytes.SetNull ();
			try {
				Assert.AreEqual (bytes.Length, 10, "#1 Should not be same");
				Assert.Fail ("Should throw SqlNullValueException");
			} catch (Exception ex) {
				Assert.AreEqual (typeof (SqlNullValueException), ex.GetType (), "Should throw SqlNullValueException");
			}
			Assert.AreEqual (true, bytes.IsNull, "#2 Should be same");
		}
All Usage Examples Of System.Data.SqlTypes.SqlBytes::SetNull