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
- BufferedWebEventProvider.cs
- Suspend.cs
- ETagAttribute.cs
- ConnectionManagementElement.cs
- HttpWebResponse.cs
- Application.cs
- IRCollection.cs
- _TimerThread.cs
- NonParentingControl.cs
- FixedDocument.cs
- SortQuery.cs
- BrowserDefinition.cs
- Constraint.cs
- TypedTableBaseExtensions.cs
- ReachDocumentReferenceSerializer.cs
- LongValidator.cs
- QilXmlReader.cs
- SingleAnimationBase.cs
- BitmapEffectDrawing.cs
- XmlUtf8RawTextWriter.cs
- SortDescription.cs
- BigIntegerStorage.cs
- PointLightBase.cs
- CodeTypeOfExpression.cs
- ThreadStaticAttribute.cs
- ProcessInfo.cs
- TrustExchangeException.cs
- IssuedSecurityTokenProvider.cs
- PEFileReader.cs
- TransformGroup.cs
- ProfileSettingsCollection.cs
- ThemeDirectoryCompiler.cs
- HitTestFilterBehavior.cs
- FontEmbeddingManager.cs
- LinqDataSourceInsertEventArgs.cs
- ConstrainedGroup.cs
- AnimationStorage.cs
- ForeignConstraint.cs
- ISO2022Encoding.cs
- SortExpressionBuilder.cs
- SequentialUshortCollection.cs
- CodeIdentifiers.cs
- MediaCommands.cs
- RtfToXamlReader.cs
- ObjectSecurityT.cs
- StateDesigner.CommentLayoutGlyph.cs
- HtmlInputReset.cs
- RelAssertionDirectKeyIdentifierClause.cs
- PeerOutputChannel.cs
- IndividualDeviceConfig.cs
- WriteFileContext.cs
- PortCache.cs
- TextDecorationUnitValidation.cs
- TypedCompletedAsyncResult.cs
- CallSiteOps.cs
- InputReportEventArgs.cs
- SendingRequestEventArgs.cs
- RuntimeCompatibilityAttribute.cs
- XXXOnTypeBuilderInstantiation.cs
- ConversionValidationRule.cs
- CharacterHit.cs
- DocumentPageViewAutomationPeer.cs
- SplitterEvent.cs
- CatalogPartCollection.cs
- TextElementCollectionHelper.cs
- SQLBinaryStorage.cs
- SiteMapNodeItemEventArgs.cs
- TableLayoutPanel.cs
- TemplatedWizardStep.cs
- ChildTable.cs
- StructuredCompositeActivityDesigner.cs
- recordstate.cs
- XmlUrlResolver.cs
- SafeFileHandle.cs
- TransportContext.cs
- OleDbFactory.cs
- OutputScopeManager.cs
- DeclarativeConditionsCollection.cs
- ResourceDisplayNameAttribute.cs
- StorageBasedPackageProperties.cs
- DataGridViewToolTip.cs
- Filter.cs
- PeerDuplexChannelListener.cs
- SqlBulkCopyColumnMappingCollection.cs
- RegexWorker.cs
- LeaseManager.cs
- SafeCoTaskMem.cs
- FullTrustAssemblyCollection.cs
- BaseParaClient.cs
- _TransmitFileOverlappedAsyncResult.cs
- OuterGlowBitmapEffect.cs
- _UncName.cs
- BinaryFormatter.cs
- SecuritySessionFilter.cs
- IsolatedStorageException.cs
- FormsAuthentication.cs
- SortQueryOperator.cs
- GeometryValueSerializer.cs
- ApplicationHost.cs
- MeshGeometry3D.cs