Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DocumentCollection.cs
- ControllableStoryboardAction.cs
- ModifiableIteratorCollection.cs
- EntityTransaction.cs
- HttpCacheParams.cs
- MimePart.cs
- CSharpCodeProvider.cs
- DoubleAnimationUsingKeyFrames.cs
- DatePicker.cs
- TextElement.cs
- ByteAnimationUsingKeyFrames.cs
- BlobPersonalizationState.cs
- TraceSwitch.cs
- UnmanagedMarshal.cs
- SingleSelectRootGridEntry.cs
- WebPartVerbsEventArgs.cs
- InstancePersistence.cs
- DnsPermission.cs
- SspiWrapper.cs
- SmiEventSink.cs
- SynchronizationHandlesCodeDomSerializer.cs
- ReadingWritingEntityEventArgs.cs
- ConfigurationSettings.cs
- MultipartContentParser.cs
- SessionStateSection.cs
- Paragraph.cs
- HopperCache.cs
- KnownColorTable.cs
- JsonReaderDelegator.cs
- SaveFileDialog.cs
- Emitter.cs
- WebPartConnectionsEventArgs.cs
- ItemCollection.cs
- MemberAssignment.cs
- SecurityTokenRequirement.cs
- InputLanguageManager.cs
- CodeIdentifiers.cs
- OleDbEnumerator.cs
- WindowsRegion.cs
- ChtmlImageAdapter.cs
- SafeSerializationManager.cs
- RenameRuleObjectDialog.cs
- StylusOverProperty.cs
- HwndHostAutomationPeer.cs
- FlowchartDesigner.xaml.cs
- ManagedWndProcTracker.cs
- TrackingRecord.cs
- DbSource.cs
- StreamReader.cs
- DataGridTextBox.cs
- VisualCollection.cs
- PathFigure.cs
- BitmapFrameDecode.cs
- RelationshipEndCollection.cs
- UnsafeNativeMethods.cs
- TransactionsSectionGroup.cs
- MarkupCompilePass2.cs
- EventLogRecord.cs
- TextDocumentView.cs
- XmlIterators.cs
- FrameworkPropertyMetadata.cs
- Normalization.cs
- ByteKeyFrameCollection.cs
- ArraySubsetEnumerator.cs
- Rotation3D.cs
- AccessibleObject.cs
- StatusBar.cs
- PassportAuthentication.cs
- DebuggerAttributes.cs
- RepeatBehaviorConverter.cs
- AppSettingsReader.cs
- ContainsSearchOperator.cs
- EFColumnProvider.cs
- Enum.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- RepeatInfo.cs
- DeploymentSection.cs
- SafeFileHandle.cs
- CodeAttributeArgumentCollection.cs
- CodeTypeMember.cs
- SqlUdtInfo.cs
- ConfigurationManager.cs
- FramingFormat.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- DefaultMemberAttribute.cs
- CompositeControl.cs
- NamespaceImport.cs
- TemplatePagerField.cs
- CodeNamespaceCollection.cs
- IndentTextWriter.cs
- MulticastNotSupportedException.cs
- CompiledRegexRunnerFactory.cs
- BitmapEffectvisualstate.cs
- PaginationProgressEventArgs.cs
- UIElement3D.cs
- ClipboardData.cs
- FileInfo.cs
- Oid.cs
- WebPartEditorCancelVerb.cs
- MultiDataTrigger.cs