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
- LinkedResource.cs
- _SafeNetHandles.cs
- TraceSection.cs
- DbQueryCommandTree.cs
- ClientSettings.cs
- UserMapPath.cs
- FixedTextSelectionProcessor.cs
- WebPermission.cs
- WebControlAdapter.cs
- BaseTemplateCodeDomTreeGenerator.cs
- HiddenFieldPageStatePersister.cs
- BrowsableAttribute.cs
- Typeface.cs
- Int32KeyFrameCollection.cs
- XmlSubtreeReader.cs
- DateRangeEvent.cs
- PropertyValue.cs
- ControlTemplate.cs
- Int32Converter.cs
- PackWebResponse.cs
- ObjectAssociationEndMapping.cs
- GeneralTransform3DTo2DTo3D.cs
- __ConsoleStream.cs
- DataGridViewCellValidatingEventArgs.cs
- FactoryMaker.cs
- CompositeDataBoundControl.cs
- SvcMapFile.cs
- Registry.cs
- DecoderNLS.cs
- XmlAnyAttributeAttribute.cs
- QuadraticBezierSegment.cs
- UTF32Encoding.cs
- Column.cs
- DataGrid.cs
- WebPartsPersonalization.cs
- DrawingCollection.cs
- RemotingConfigParser.cs
- _Win32.cs
- ILGen.cs
- PlacementWorkspace.cs
- NativeMethods.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- HyperLinkField.cs
- ProcessHostMapPath.cs
- ScrollProviderWrapper.cs
- PublisherMembershipCondition.cs
- AudioBase.cs
- AppSettingsSection.cs
- MexNamedPipeBindingCollectionElement.cs
- ProgressChangedEventArgs.cs
- RtfToken.cs
- SoapCodeExporter.cs
- ErrorItem.cs
- RewritingValidator.cs
- SkewTransform.cs
- COSERVERINFO.cs
- MembershipSection.cs
- ServiceThrottle.cs
- ScriptReferenceEventArgs.cs
- SchemeSettingElement.cs
- cookiecontainer.cs
- TextTreeFixupNode.cs
- SymbolEqualComparer.cs
- BamlRecordHelper.cs
- CursorEditor.cs
- MouseCaptureWithinProperty.cs
- WebPartsPersonalizationAuthorization.cs
- FirstMatchCodeGroup.cs
- WebHeaderCollection.cs
- NullableFloatAverageAggregationOperator.cs
- OdbcCommandBuilder.cs
- SerializationObjectManager.cs
- KeyboardDevice.cs
- BitmapPalettes.cs
- DnsElement.cs
- TableLayoutCellPaintEventArgs.cs
- AppDomainInfo.cs
- DelegateSerializationHolder.cs
- SqlConnectionString.cs
- BitmapMetadataBlob.cs
- CopyAttributesAction.cs
- HtmlImage.cs
- StickyNoteContentControl.cs
- ContextBase.cs
- BatchServiceHost.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- DataBinder.cs
- WebConfigurationHostFileChange.cs
- InvalidComObjectException.cs
- HeaderedContentControl.cs
- KerberosSecurityTokenParameters.cs
- SqlPersonalizationProvider.cs
- ApplicationInfo.cs
- CommonDialog.cs
- SafeLibraryHandle.cs
- RectAnimationClockResource.cs
- ScanQueryOperator.cs
- LabelDesigner.cs
- ReferencedAssemblyResolver.cs
- HtmlHead.cs