Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / DBNull.cs / 1305376 / 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; using System.Security.Permissions; [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(); [System.Security.SecurityCritical] 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MetadataException.cs
- ObjectIDGenerator.cs
- FormsAuthentication.cs
- ContentValidator.cs
- NativeMethodsCLR.cs
- TokenBasedSet.cs
- TraversalRequest.cs
- ApplicationServiceHelper.cs
- LeaseManager.cs
- StylusTip.cs
- FontWeights.cs
- MessageBox.cs
- PerformanceCounterPermissionEntryCollection.cs
- Int64AnimationBase.cs
- DataGridColumn.cs
- CopyAction.cs
- ConfigurationSection.cs
- LocatorManager.cs
- DoubleSumAggregationOperator.cs
- FlatButtonAppearance.cs
- XmlAttributes.cs
- QilPatternVisitor.cs
- WSSecurityPolicy12.cs
- RequestCachePolicy.cs
- XmlNotation.cs
- RadioButtonList.cs
- CustomErrorsSection.cs
- ReachDocumentReferenceCollectionSerializerAsync.cs
- Profiler.cs
- ObjectDataSourceDesigner.cs
- ContentFileHelper.cs
- HtmlInputControl.cs
- QilFactory.cs
- InternalBufferOverflowException.cs
- ConsoleTraceListener.cs
- EmissiveMaterial.cs
- SQLGuidStorage.cs
- SplashScreenNativeMethods.cs
- ColorDialog.cs
- Win32MouseDevice.cs
- MediaScriptCommandRoutedEventArgs.cs
- SerTrace.cs
- AxHost.cs
- Path.cs
- RadioButton.cs
- IntranetCredentialPolicy.cs
- ConnectionInterfaceCollection.cs
- BrowserDefinitionCollection.cs
- FileNotFoundException.cs
- BasicHttpMessageSecurityElement.cs
- SqlAliasesReferenced.cs
- BindingNavigator.cs
- PathFigure.cs
- WebBaseEventKeyComparer.cs
- XPathNodeList.cs
- ListMarkerSourceInfo.cs
- TextRunProperties.cs
- TimeBoundedCache.cs
- DocumentSequence.cs
- DataRecordInfo.cs
- ColumnTypeConverter.cs
- ControlBuilderAttribute.cs
- DisplayInformation.cs
- EntityViewGenerationAttribute.cs
- ModelUIElement3D.cs
- VariableQuery.cs
- ObjectIDGenerator.cs
- StaticSiteMapProvider.cs
- DataTableCollection.cs
- PrintingPermission.cs
- RowToFieldTransformer.cs
- SelectionEditor.cs
- TreeIterator.cs
- XmlReader.cs
- MimeReflector.cs
- XPathAncestorIterator.cs
- GeneralTransform3DTo2D.cs
- BreakRecordTable.cs
- DuplicateWaitObjectException.cs
- ByteStream.cs
- SingleAnimationUsingKeyFrames.cs
- LoginDesigner.cs
- CompilerScope.cs
- SoapTypeAttribute.cs
- InputLanguageManager.cs
- State.cs
- XmlHierarchicalEnumerable.cs
- MemberDescriptor.cs
- PackWebRequestFactory.cs
- RenderTargetBitmap.cs
- SessionPageStatePersister.cs
- Int32.cs
- FlowDocumentReader.cs
- ReferenceTypeElement.cs
- SqlClientWrapperSmiStreamChars.cs
- PropertyFilterAttribute.cs
- HashSet.cs
- ButtonColumn.cs
- Transform3DCollection.cs
- XmlSortKey.cs