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
- XamlTypeWithExplicitNamespace.cs
- SessionParameter.cs
- XmlUtilWriter.cs
- QueueException.cs
- GridProviderWrapper.cs
- DataTransferEventArgs.cs
- GacUtil.cs
- HttpResponseHeader.cs
- ScriptingJsonSerializationSection.cs
- QilParameter.cs
- SelectionPattern.cs
- HScrollBar.cs
- Int16Animation.cs
- CommonObjectSecurity.cs
- ProfileManager.cs
- SQLInt16Storage.cs
- AnnotationResourceChangedEventArgs.cs
- Validator.cs
- Literal.cs
- XamlClipboardData.cs
- SoapEnumAttribute.cs
- DataGridHeaderBorder.cs
- UIElementAutomationPeer.cs
- RowsCopiedEventArgs.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- HashCoreRequest.cs
- BasicExpressionVisitor.cs
- QuaternionIndependentAnimationStorage.cs
- OAVariantLib.cs
- CompilerScopeManager.cs
- DataPagerCommandEventArgs.cs
- BridgeDataRecord.cs
- XmlChildNodes.cs
- Int32Animation.cs
- PathStreamGeometryContext.cs
- FileDialogCustomPlace.cs
- DataSourceControlBuilder.cs
- TemporaryBitmapFile.cs
- ObjectDataSourceMethodEventArgs.cs
- ProgressChangedEventArgs.cs
- DataSetFieldSchema.cs
- Int32.cs
- SiteOfOriginContainer.cs
- ThreadInterruptedException.cs
- _SslSessionsCache.cs
- CompareValidator.cs
- NamespaceEmitter.cs
- XmlQueryRuntime.cs
- EntityViewContainer.cs
- HttpException.cs
- _ScatterGatherBuffers.cs
- BindingValueChangedEventArgs.cs
- BCLDebug.cs
- RuleSettingsCollection.cs
- TextServicesDisplayAttribute.cs
- MenuItemStyleCollection.cs
- DataGridViewCellEventArgs.cs
- MenuItemBindingCollection.cs
- RangeValidator.cs
- TextPatternIdentifiers.cs
- HttpConfigurationSystem.cs
- OleDbConnectionInternal.cs
- XPathNavigatorKeyComparer.cs
- OracleParameter.cs
- DataGridViewCellFormattingEventArgs.cs
- RenameRuleObjectDialog.Designer.cs
- SerializationException.cs
- ThreadPool.cs
- GB18030Encoding.cs
- OdbcEnvironment.cs
- CalendarAutoFormat.cs
- TimeSpanMinutesConverter.cs
- ControlCachePolicy.cs
- DoubleAnimationUsingKeyFrames.cs
- RootDesignerSerializerAttribute.cs
- CacheOutputQuery.cs
- XmlSortKey.cs
- OdbcDataReader.cs
- MinMaxParagraphWidth.cs
- DataGridViewRowEventArgs.cs
- COM2AboutBoxPropertyDescriptor.cs
- ErrorHandler.cs
- BaseCodePageEncoding.cs
- IdentityValidationException.cs
- ParentUndoUnit.cs
- GridViewRowEventArgs.cs
- EnumConverter.cs
- ProfileManager.cs
- XmlChoiceIdentifierAttribute.cs
- MetadataSerializer.cs
- SrgsElementList.cs
- LoginName.cs
- XPathBinder.cs
- DetailsViewUpdatedEventArgs.cs
- TableRowsCollectionEditor.cs
- UrlMappingsModule.cs
- Coordinator.cs
- Misc.cs
- Compress.cs
- SdlChannelSink.cs