Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InstanceLockedException.cs
- DesignColumn.cs
- RC2.cs
- CodeValidator.cs
- KeyConstraint.cs
- HtmlGenericControl.cs
- VerificationAttribute.cs
- XsdBuildProvider.cs
- KerberosReceiverSecurityToken.cs
- XmlnsDefinitionAttribute.cs
- PropertyInfo.cs
- HtmlTableRowCollection.cs
- ClientTarget.cs
- ImageClickEventArgs.cs
- ConfigDefinitionUpdates.cs
- Socket.cs
- SerializationTrace.cs
- SafeEventLogWriteHandle.cs
- CompoundFileStreamReference.cs
- ProtocolsConfigurationHandler.cs
- DtcInterfaces.cs
- ControlParameter.cs
- DeleteStoreRequest.cs
- AsymmetricAlgorithm.cs
- DataGridViewCellStyleBuilderDialog.cs
- XmlElementAttribute.cs
- NewExpression.cs
- Item.cs
- ActivationArguments.cs
- BuildProvider.cs
- WsiProfilesElement.cs
- Int32AnimationUsingKeyFrames.cs
- Parameter.cs
- Visitors.cs
- LaxModeSecurityHeaderElementInferenceEngine.cs
- ToolStripProgressBar.cs
- SR.cs
- LoginUtil.cs
- DbParameterHelper.cs
- PropertyMetadata.cs
- MediaScriptCommandRoutedEventArgs.cs
- UnsafeMethods.cs
- XmlDigitalSignatureProcessor.cs
- SafeRegistryHandle.cs
- ReadOnlyPropertyMetadata.cs
- TextPatternIdentifiers.cs
- DataTableCollection.cs
- SpeechEvent.cs
- BufferModesCollection.cs
- MemberAccessException.cs
- GiveFeedbackEvent.cs
- CalendarDataBindingHandler.cs
- CroppedBitmap.cs
- SByteConverter.cs
- GetMemberBinder.cs
- LicenseProviderAttribute.cs
- OdbcDataReader.cs
- TableCellCollection.cs
- securitymgrsite.cs
- PkcsMisc.cs
- AppDomainManager.cs
- ParallelDesigner.xaml.cs
- SynchronizationValidator.cs
- DeferrableContent.cs
- XmlBaseReader.cs
- SafeFileMapViewHandle.cs
- XmlDigitalSignatureProcessor.cs
- InputBindingCollection.cs
- GlobalProxySelection.cs
- Win32MouseDevice.cs
- RenderContext.cs
- FontConverter.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- CryptoApi.cs
- FamilyTypefaceCollection.cs
- VisualCollection.cs
- ISAPIWorkerRequest.cs
- TemplatePropertyEntry.cs
- CodeAttributeDeclaration.cs
- PrimitiveXmlSerializers.cs
- Proxy.cs
- TraceListeners.cs
- webbrowsersite.cs
- TextClipboardData.cs
- isolationinterop.cs
- StructuredTypeInfo.cs
- TableRowCollection.cs
- NamespaceMapping.cs
- CodeArgumentReferenceExpression.cs
- OrderByExpression.cs
- TextContainer.cs
- Table.cs
- ComponentGuaranteesAttribute.cs
- TransactedBatchContext.cs
- OdbcCommand.cs
- ExceptionUtil.cs
- IconEditor.cs
- SqlConnectionHelper.cs
- PartManifestEntry.cs
- WebPartConnectionsEventArgs.cs