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
- TransformProviderWrapper.cs
- DescendantOverDescendantQuery.cs
- SimpleLine.cs
- WebFaultClientMessageInspector.cs
- CultureTableRecord.cs
- NullableConverter.cs
- NavigateEvent.cs
- HighlightVisual.cs
- Utility.cs
- DataProtectionSecurityStateEncoder.cs
- DecimalAnimation.cs
- DesignerProperties.cs
- ManifestResourceInfo.cs
- UncommonField.cs
- ClientTarget.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- FullTextState.cs
- FontUnitConverter.cs
- HttpValueCollection.cs
- sqlnorm.cs
- Clipboard.cs
- BoundPropertyEntry.cs
- Exception.cs
- ValueChangedEventManager.cs
- LinkArea.cs
- CodeSubDirectoriesCollection.cs
- initElementDictionary.cs
- SafeNativeMethods.cs
- QueryOutputWriter.cs
- ColorPalette.cs
- UniformGrid.cs
- ClientRoleProvider.cs
- FileDialogCustomPlace.cs
- GeometryModel3D.cs
- FramingFormat.cs
- CryptoConfig.cs
- Listbox.cs
- SortKey.cs
- EDesignUtil.cs
- HttpResponseInternalWrapper.cs
- DiagnosticsConfigurationHandler.cs
- SmtpNetworkElement.cs
- SafeMarshalContext.cs
- LayoutSettings.cs
- FontFamilyConverter.cs
- ScriptManagerProxy.cs
- SiteMapNodeItem.cs
- DataDocumentXPathNavigator.cs
- SynchronizedDispatch.cs
- RegisteredExpandoAttribute.cs
- FormViewUpdateEventArgs.cs
- WaitHandle.cs
- BaseUriWithWildcard.cs
- IPipelineRuntime.cs
- PropertyEmitterBase.cs
- HtmlInputText.cs
- COM2ICategorizePropertiesHandler.cs
- CqlQuery.cs
- DispatcherHookEventArgs.cs
- DiffuseMaterial.cs
- MultiSelector.cs
- DataGridRowAutomationPeer.cs
- NumericPagerField.cs
- FrameworkElement.cs
- FontInfo.cs
- DBAsyncResult.cs
- DataGridColumnCollection.cs
- ButtonAutomationPeer.cs
- HtmlInputCheckBox.cs
- WebDisplayNameAttribute.cs
- SolidColorBrush.cs
- SoapAttributeOverrides.cs
- NumericPagerField.cs
- EntityTypeEmitter.cs
- SessionIDManager.cs
- LogoValidationException.cs
- ConfigXmlAttribute.cs
- SmtpFailedRecipientException.cs
- ItemMap.cs
- DataGridGeneralPage.cs
- ClientConfigurationSystem.cs
- DesignOnlyAttribute.cs
- InlineCollection.cs
- RadioButton.cs
- WebService.cs
- StyleBamlRecordReader.cs
- TypeUsageBuilder.cs
- MoveSizeWinEventHandler.cs
- SerialErrors.cs
- GeneralTransform2DTo3D.cs
- BinaryObjectWriter.cs
- CursorConverter.cs
- DataIdProcessor.cs
- CrossSiteScriptingValidation.cs
- DataGridViewDataErrorEventArgs.cs
- SQLStringStorage.cs
- LockCookie.cs
- WebServicesInteroperability.cs
- SqlIdentifier.cs
- ConnectionStringsSection.cs