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
- RuleConditionDialog.cs
- BitmapData.cs
- ObjectContext.cs
- GeometryConverter.cs
- DbDataAdapter.cs
- COM2Properties.cs
- InputLanguageSource.cs
- TranslateTransform3D.cs
- DocumentXPathNavigator.cs
- SizeLimitedCache.cs
- ValidationResult.cs
- DataBindingHandlerAttribute.cs
- CallSite.cs
- While.cs
- CategoryEditor.cs
- SqlDataReader.cs
- FixedHyperLink.cs
- SHA512CryptoServiceProvider.cs
- GenericTypeParameterBuilder.cs
- IOThreadScheduler.cs
- EntitySqlQueryCacheEntry.cs
- TextEvent.cs
- PropertyContainer.cs
- _SSPIWrapper.cs
- MetafileHeaderWmf.cs
- SHA256.cs
- ContainerUtilities.cs
- ISFTagAndGuidCache.cs
- HTTPNotFoundHandler.cs
- BindingGroup.cs
- XmlSchemaCompilationSettings.cs
- RepeaterItem.cs
- UrlUtility.cs
- SHA384.cs
- RoleManagerEventArgs.cs
- ReadOnlyDataSourceView.cs
- DataGridRowAutomationPeer.cs
- FontCollection.cs
- Brush.cs
- DataObjectFieldAttribute.cs
- InvalidDataException.cs
- MenuItem.cs
- ChangeProcessor.cs
- WebPartCancelEventArgs.cs
- MoveSizeWinEventHandler.cs
- ToolStripComboBox.cs
- EntitySetBaseCollection.cs
- ListBindingConverter.cs
- CodeSnippetTypeMember.cs
- StateMachineWorkflow.cs
- odbcmetadatacolumnnames.cs
- DiagnosticsConfiguration.cs
- WebPartManager.cs
- XmlSchemaSimpleTypeUnion.cs
- TrackingMemoryStream.cs
- WinFormsUtils.cs
- SqlUtils.cs
- ClientEndpointLoader.cs
- MultilineStringEditor.cs
- SQLDateTime.cs
- TimeIntervalCollection.cs
- TypeElement.cs
- ProfileModule.cs
- PeerNearMe.cs
- DesignOnlyAttribute.cs
- FrameworkPropertyMetadata.cs
- ToolStripHighContrastRenderer.cs
- SiblingIterators.cs
- XamlStackWriter.cs
- PersistencePipeline.cs
- TimeSpanConverter.cs
- SocketCache.cs
- ImageBrush.cs
- TCPClient.cs
- SapiRecoContext.cs
- ObjectPersistData.cs
- EdmPropertyAttribute.cs
- ILGenerator.cs
- QueryInterceptorAttribute.cs
- TypeToArgumentTypeConverter.cs
- TraceShell.cs
- DiscoveryClientChannelBase.cs
- ToolStripGrip.cs
- OperationResponse.cs
- ToReply.cs
- DataComponentNameHandler.cs
- SelectionChangedEventArgs.cs
- Container.cs
- RuleAction.cs
- XamlFigureLengthSerializer.cs
- RowBinding.cs
- ItemCheckedEvent.cs
- OuterGlowBitmapEffect.cs
- Underline.cs
- _SslState.cs
- ArgumentValidation.cs
- ITextView.cs
- DataGridViewRowHeaderCell.cs
- ForeignKeyConstraint.cs
- DbParameterHelper.cs