Code:
/ DotNET / DotNET / 8.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
- SafeProcessHandle.cs
- DynamicRenderer.cs
- TextDecoration.cs
- AuditLogLocation.cs
- SqlTypesSchemaImporter.cs
- Opcode.cs
- TraceSwitch.cs
- FormatConvertedBitmap.cs
- LoggedException.cs
- DescriptionAttribute.cs
- TCPClient.cs
- DoubleLink.cs
- WebDisplayNameAttribute.cs
- ValidationErrorEventArgs.cs
- ModelVisual3D.cs
- GridViewColumn.cs
- MSHTMLHost.cs
- RegexWorker.cs
- DPAPIProtectedConfigurationProvider.cs
- AxDesigner.cs
- HostProtectionException.cs
- GeneratedContractType.cs
- KeyedHashAlgorithm.cs
- SoapWriter.cs
- TranslateTransform.cs
- Span.cs
- SafeSecurityHandles.cs
- TypedTableBase.cs
- DeviceSpecificDialogCachedState.cs
- CategoryAttribute.cs
- XpsThumbnail.cs
- WebResponse.cs
- ZipIOExtraFieldElement.cs
- DropDownButton.cs
- ClientTargetSection.cs
- KeyPressEvent.cs
- DocumentSequenceHighlightLayer.cs
- CompositeControl.cs
- AnnotationStore.cs
- PageAsyncTask.cs
- BitmapDecoder.cs
- IOThreadScheduler.cs
- StorageConditionPropertyMapping.cs
- EntitySqlQueryCacheEntry.cs
- GacUtil.cs
- DropSource.cs
- SoapDocumentServiceAttribute.cs
- TemplateBamlRecordReader.cs
- SspiSecurityTokenProvider.cs
- figurelengthconverter.cs
- FixedPageStructure.cs
- PropertyEmitter.cs
- VideoDrawing.cs
- RealProxy.cs
- Int64.cs
- CellParagraph.cs
- cookiecollection.cs
- SqlDataReader.cs
- ShaperBuffers.cs
- MemberAccessException.cs
- HyperLinkField.cs
- CollectionViewGroup.cs
- RemoveStoryboard.cs
- DummyDataSource.cs
- UnionCqlBlock.cs
- PermissionAttributes.cs
- GeneralTransform3D.cs
- SafeNativeMethods.cs
- MediaPlayerState.cs
- COAUTHIDENTITY.cs
- Wizard.cs
- LocatorBase.cs
- SerializeAbsoluteContext.cs
- SpellCheck.cs
- ApplicationContext.cs
- GridPattern.cs
- Condition.cs
- UTF32Encoding.cs
- _NestedSingleAsyncResult.cs
- Themes.cs
- Task.cs
- Int64.cs
- XmlSchemaSet.cs
- XmlElementAttribute.cs
- ProfileSettings.cs
- CopyAttributesAction.cs
- NonVisualControlAttribute.cs
- DataGridViewCellLinkedList.cs
- VSWCFServiceContractGenerator.cs
- TimeSpanStorage.cs
- OleDbSchemaGuid.cs
- FontCacheLogic.cs
- util.cs
- ToolStripSplitButton.cs
- SQLSingle.cs
- UserControlCodeDomTreeGenerator.cs
- SelectionPatternIdentifiers.cs
- DecimalAnimationUsingKeyFrames.cs
- WebBrowser.cs
- UriScheme.cs