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
- configsystem.cs
- GACIdentityPermission.cs
- mactripleDES.cs
- ToolStripDropTargetManager.cs
- CapabilitiesSection.cs
- ContractListAdapter.cs
- PathNode.cs
- BamlMapTable.cs
- XmlTextReaderImplHelpers.cs
- MutableAssemblyCacheEntry.cs
- CollectionType.cs
- XmlChoiceIdentifierAttribute.cs
- WindowProviderWrapper.cs
- Pen.cs
- LocationSectionRecord.cs
- ListChangedEventArgs.cs
- RoleGroup.cs
- ConfigWriter.cs
- WindowsPrincipal.cs
- Subset.cs
- PreparingEnlistment.cs
- SystemBrushes.cs
- ResourceAttributes.cs
- DataGridViewEditingControlShowingEventArgs.cs
- ObjectConverter.cs
- RayMeshGeometry3DHitTestResult.cs
- Thickness.cs
- ImageBrush.cs
- Latin1Encoding.cs
- BoundsDrawingContextWalker.cs
- InkCollectionBehavior.cs
- ApplicationSecurityManager.cs
- Trigger.cs
- AppSecurityManager.cs
- XmlSchemaComplexType.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- MarshalDirectiveException.cs
- DefaultSection.cs
- ProcessingInstructionAction.cs
- ContainerUtilities.cs
- HtmlInputControl.cs
- GrammarBuilderPhrase.cs
- BooleanToVisibilityConverter.cs
- HttpHostedTransportConfiguration.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- ConfigurationStrings.cs
- DataColumnSelectionConverter.cs
- _NegoStream.cs
- ProfileGroupSettings.cs
- SetterBase.cs
- Button.cs
- Transform.cs
- SoapExtensionImporter.cs
- Setter.cs
- FontUnit.cs
- PageBreakRecord.cs
- ElementHost.cs
- SystemEvents.cs
- EventItfInfo.cs
- XmlEntity.cs
- WorkflowMarkupElementEventArgs.cs
- PartBasedPackageProperties.cs
- GacUtil.cs
- PointCollectionValueSerializer.cs
- QuaternionRotation3D.cs
- ComplusEndpointConfigContainer.cs
- ResourceAttributes.cs
- MDIControlStrip.cs
- EntityDataReader.cs
- figurelength.cs
- ObjectAnimationUsingKeyFrames.cs
- IntersectQueryOperator.cs
- ColumnMapTranslator.cs
- Clock.cs
- AutoResizedEvent.cs
- RetrieveVirtualItemEventArgs.cs
- SamlSerializer.cs
- FormatVersion.cs
- EditorPartCollection.cs
- ProviderConnectionPoint.cs
- MetafileHeaderWmf.cs
- RootBrowserWindowProxy.cs
- ClientSettingsStore.cs
- StringExpressionSet.cs
- SqlCacheDependencyDatabaseCollection.cs
- XPathDocumentNavigator.cs
- SafeSecurityHandles.cs
- DetailsViewPageEventArgs.cs
- LicFileLicenseProvider.cs
- ComponentRenameEvent.cs
- SqlParameterCollection.cs
- StringKeyFrameCollection.cs
- ControlUtil.cs
- RequestSecurityToken.cs
- ParseHttpDate.cs
- log.cs
- StructuredTypeEmitter.cs
- SqlFactory.cs
- BasePattern.cs
- BuildManager.cs