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
- RelationshipConverter.cs
- ContextMenu.cs
- NodeFunctions.cs
- LambdaCompiler.Generated.cs
- UnsafeNativeMethodsPenimc.cs
- SpeakProgressEventArgs.cs
- Overlapped.cs
- RIPEMD160.cs
- ListBoxAutomationPeer.cs
- ExtendedPropertyDescriptor.cs
- PropertyRef.cs
- ZipIOCentralDirectoryFileHeader.cs
- LiteralControl.cs
- WebPartConnectionsConfigureVerb.cs
- Int16KeyFrameCollection.cs
- FormattedText.cs
- UpDownEvent.cs
- PrintPageEvent.cs
- SchemaSetCompiler.cs
- ObjectDisposedException.cs
- GiveFeedbackEventArgs.cs
- HandleValueEditor.cs
- CopyAttributesAction.cs
- ExclusiveTcpListener.cs
- XmlDataSourceView.cs
- TableAdapterManagerHelper.cs
- FilteredDataSetHelper.cs
- MexHttpBindingElement.cs
- ScriptBehaviorDescriptor.cs
- ScriptHandlerFactory.cs
- XmlSchemaInferenceException.cs
- Scripts.cs
- EnumDataContract.cs
- CroppedBitmap.cs
- HitTestDrawingContextWalker.cs
- DictionaryItemsCollection.cs
- AudienceUriMode.cs
- FlowLayoutSettings.cs
- RoutedUICommand.cs
- RestClientProxyHandler.cs
- XmlSchemaInferenceException.cs
- DirectoryInfo.cs
- VideoDrawing.cs
- RepeaterDesigner.cs
- Tracking.cs
- XsdCachingReader.cs
- XmlElementList.cs
- Menu.cs
- SynchronizationLockException.cs
- RewritingSimplifier.cs
- TypeHelper.cs
- AudioException.cs
- SubstitutionList.cs
- ToolCreatedEventArgs.cs
- TextCompositionManager.cs
- WindowsFormsHostAutomationPeer.cs
- CapabilitiesUse.cs
- HtmlGenericControl.cs
- PersonalizationProviderCollection.cs
- DataPager.cs
- GcSettings.cs
- DynamicResourceExtensionConverter.cs
- X509ChainElement.cs
- Int32Rect.cs
- NotifyIcon.cs
- DesignerDataParameter.cs
- QueuePropertyVariants.cs
- ScalarType.cs
- PropertyOverridesDialog.cs
- InstallerTypeAttribute.cs
- Int64Animation.cs
- Location.cs
- EditorPartDesigner.cs
- HttpApplicationFactory.cs
- NativeMethods.cs
- DataSetMappper.cs
- MergeFilterQuery.cs
- WebPartCatalogAddVerb.cs
- RolePrincipal.cs
- X509ClientCertificateCredentialsElement.cs
- ApplicationCommands.cs
- Vector3DKeyFrameCollection.cs
- TempFiles.cs
- TextTreeInsertElementUndoUnit.cs
- ValidationError.cs
- ManipulationDelta.cs
- DemultiplexingDispatchMessageFormatter.cs
- PolicyUtility.cs
- ToolboxItemAttribute.cs
- WindowsFormsSynchronizationContext.cs
- DesignerHelpers.cs
- SetIndexBinder.cs
- DeploymentSectionCache.cs
- _HeaderInfoTable.cs
- StreamReader.cs
- Clipboard.cs
- IgnoreFlushAndCloseStream.cs
- ServiceChannel.cs
- ContextProperty.cs
- ValidationSummary.cs