Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / DBNull.cs / 1 / DBNull.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //////////////////////////////////////////////////////////////////////////////// // Void // This class represents a Missing Variant //////////////////////////////////////////////////////////////////////////////// namespace System { using System; using System.Runtime.Remoting; using System.Runtime.Serialization; [System.Runtime.InteropServices.ComVisible(true)] [Serializable()] public sealed class DBNull : ISerializable, IConvertible { //Package private constructor private DBNull(){ } private DBNull(SerializationInfo info, StreamingContext context) { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DBNullSerial")); } public static readonly DBNull Value = new DBNull(); public void GetObjectData(SerializationInfo info, StreamingContext context) { UnitySerializationHolder.GetUnitySerializationInfo(info, UnitySerializationHolder.NullUnity, null, null); } public override String ToString() { return String.Empty; } public String ToString(IFormatProvider provider) { return String.Empty; } public TypeCode GetTypeCode() { return TypeCode.DBNull; } ///bool IConvertible.ToBoolean(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// char IConvertible.ToChar(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// sbyte IConvertible.ToSByte(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// byte IConvertible.ToByte(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// short IConvertible.ToInt16(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// ushort IConvertible.ToUInt16(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// int IConvertible.ToInt32(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// uint IConvertible.ToUInt32(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// long IConvertible.ToInt64(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// ulong IConvertible.ToUInt64(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// float IConvertible.ToSingle(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// double IConvertible.ToDouble(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// decimal IConvertible.ToDecimal(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// DateTime IConvertible.ToDateTime(IFormatProvider provider) { throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// Object IConvertible.ToType(Type type, IFormatProvider provider) { return Convert.DefaultToType((IConvertible)this, type, provider); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReturnType.cs
- OdbcConnectionPoolProviderInfo.cs
- PolyQuadraticBezierSegment.cs
- CodeCastExpression.cs
- RangeBaseAutomationPeer.cs
- ECDiffieHellmanPublicKey.cs
- Utils.cs
- BindingManagerDataErrorEventArgs.cs
- SqlError.cs
- ExternalDataExchangeService.cs
- IDQuery.cs
- SiteMapNodeItem.cs
- HeaderUtility.cs
- DetailsViewRowCollection.cs
- XmlUtil.cs
- QuerySetOp.cs
- Rotation3D.cs
- ListBase.cs
- AttachedAnnotation.cs
- Model3DGroup.cs
- ButtonStandardAdapter.cs
- ExtractedStateEntry.cs
- Int32Converter.cs
- ContentHostHelper.cs
- UIElement.cs
- DefaultSection.cs
- ServiceModelSectionGroup.cs
- SafeRightsManagementHandle.cs
- ImpersonateTokenRef.cs
- PartialCachingControl.cs
- SoapRpcServiceAttribute.cs
- XPathParser.cs
- ErrorHandler.cs
- Pair.cs
- DbConnectionStringCommon.cs
- FormsAuthenticationConfiguration.cs
- VirtualPathUtility.cs
- RSAOAEPKeyExchangeDeformatter.cs
- TraceSection.cs
- KoreanCalendar.cs
- MultiView.cs
- TriggerAction.cs
- ValidationContext.cs
- ListBindingConverter.cs
- Container.cs
- ADMembershipProvider.cs
- LinqToSqlWrapper.cs
- ProfessionalColorTable.cs
- GeneralTransform2DTo3DTo2D.cs
- KeyValuePair.cs
- XmlnsDefinitionAttribute.cs
- TraceSection.cs
- TableLayoutColumnStyleCollection.cs
- ADMembershipProvider.cs
- Location.cs
- StringBlob.cs
- ListDependantCardsRequest.cs
- HyperlinkAutomationPeer.cs
- SQLByte.cs
- Pen.cs
- ApplicationDirectoryMembershipCondition.cs
- AnchorEditor.cs
- CachedCompositeFamily.cs
- StatusStrip.cs
- FormViewPageEventArgs.cs
- SkinBuilder.cs
- SizeKeyFrameCollection.cs
- ItemDragEvent.cs
- xdrvalidator.cs
- ComponentEditorPage.cs
- BinaryConverter.cs
- SoapExtension.cs
- DirectoryObjectSecurity.cs
- XsdBuilder.cs
- LinqDataSourceHelper.cs
- XmlObjectSerializerReadContext.cs
- FlowDocumentFormatter.cs
- RawStylusInputCustomData.cs
- FastEncoder.cs
- SqlLiftIndependentRowExpressions.cs
- WebBrowser.cs
- SocketException.cs
- RegexCompilationInfo.cs
- SQLInt32.cs
- GridViewColumnCollection.cs
- UnsafeNativeMethodsTablet.cs
- MappingItemCollection.cs
- MediaTimeline.cs
- HtmlInputPassword.cs
- MetadataItemCollectionFactory.cs
- XmlDocumentFragment.cs
- UIElement.cs
- BitmapCodecInfoInternal.cs
- FontStyleConverter.cs
- NativeCppClassAttribute.cs
- DataGridRowEventArgs.cs
- NotImplementedException.cs
- ConstraintCollection.cs
- KeyValuePair.cs
- PlatformNotSupportedException.cs