Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / ndp / fx / src / Data / System / Data / SqlClient / SqlError.cs / 1 / SqlError.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.SqlClient { using System; using System.Diagnostics; using System.Globalization; [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class SqlError { // bug fix - MDAC 48965 - missing source of exception // fixed by [....] private string source = TdsEnums.SQL_PROVIDER_NAME; private int number; private byte state; private byte errorClass; [System.Runtime.Serialization.OptionalFieldAttribute(VersionAdded=2)] private string server; private string message; private string procedure; private int lineNumber; internal SqlError(int infoNumber, byte errorState, byte errorClass, string server, string errorMessage, string procedure, int lineNumber) { this.number = infoNumber; this.state = errorState; this.errorClass = errorClass; this.server = server; this.message = errorMessage; this.procedure = procedure; this.lineNumber = lineNumber; if (errorClass != 0) { Bid.Trace("infoNumber=%d, errorState=%d, errorClass=%d, errorMessage='%ls', procedure='%ls', lineNumber=%d\n" , infoNumber, (int)errorState, (int)errorClass, errorMessage, procedure == null ? "None" : procedure, (int)lineNumber); } } // bug fix - MDAC #49280 - SqlError does not implement ToString(); // I did not include an exception stack because the correct exception stack is only available // on SqlException, and to obtain that the SqlError would have to have backpointers all the // way back to SqlException. If the user needs a call stack, they can obtain it on SqlException. public override string ToString() { //return this.GetType().ToString() + ": " + this.message; return typeof(SqlError).ToString() + ": " + this.message; // since this is sealed so we can change GetType to typeof } // bug fix - MDAC #48965 - missing source of exception // fixed by [....] public string Source { get { return this.source;} } public int Number { get { return this.number;} } public byte State { get { return this.state;} } public byte Class { get { return this.errorClass;} } public string Server { get { return this.server;} } public string Message { get { return this.message;} } public string Procedure { get { return this.procedure;} } public int LineNumber { get { return this.lineNumber;} } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //[....] //[....] //----------------------------------------------------------------------------- namespace System.Data.SqlClient { using System; using System.Diagnostics; using System.Globalization; [Serializable] #if WINFSInternalOnly internal #else public #endif sealed class SqlError { // bug fix - MDAC 48965 - missing source of exception // fixed by [....] private string source = TdsEnums.SQL_PROVIDER_NAME; private int number; private byte state; private byte errorClass; [System.Runtime.Serialization.OptionalFieldAttribute(VersionAdded=2)] private string server; private string message; private string procedure; private int lineNumber; internal SqlError(int infoNumber, byte errorState, byte errorClass, string server, string errorMessage, string procedure, int lineNumber) { this.number = infoNumber; this.state = errorState; this.errorClass = errorClass; this.server = server; this.message = errorMessage; this.procedure = procedure; this.lineNumber = lineNumber; if (errorClass != 0) { Bid.Trace("infoNumber=%d, errorState=%d, errorClass=%d, errorMessage='%ls', procedure='%ls', lineNumber=%d\n" , infoNumber, (int)errorState, (int)errorClass, errorMessage, procedure == null ? "None" : procedure, (int)lineNumber); } } // bug fix - MDAC #49280 - SqlError does not implement ToString(); // I did not include an exception stack because the correct exception stack is only available // on SqlException, and to obtain that the SqlError would have to have backpointers all the // way back to SqlException. If the user needs a call stack, they can obtain it on SqlException. public override string ToString() { //return this.GetType().ToString() + ": " + this.message; return typeof(SqlError).ToString() + ": " + this.message; // since this is sealed so we can change GetType to typeof } // bug fix - MDAC #48965 - missing source of exception // fixed by [....] public string Source { get { return this.source;} } public int Number { get { return this.number;} } public byte State { get { return this.state;} } public byte Class { get { return this.errorClass;} } public string Server { get { return this.server;} } public string Message { get { return this.message;} } public string Procedure { get { return this.procedure;} } public int LineNumber { get { return this.lineNumber;} } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeDescriptor.cs
- EventSinkHelperWriter.cs
- RecognizedAudio.cs
- BuilderPropertyEntry.cs
- AnimationClockResource.cs
- GeneratedCodeAttribute.cs
- Transform3DGroup.cs
- RegexMatch.cs
- PtsCache.cs
- MemoryStream.cs
- BitHelper.cs
- CodeDomDecompiler.cs
- ProxyFragment.cs
- SqlUDTStorage.cs
- ZipIOCentralDirectoryBlock.cs
- WhereaboutsReader.cs
- ActivityFunc.cs
- ForEachDesigner.xaml.cs
- Encoder.cs
- ExeConfigurationFileMap.cs
- CompiledQuery.cs
- MobileTemplatedControlDesigner.cs
- DataListCommandEventArgs.cs
- ObjectConverter.cs
- SHA256Managed.cs
- MemoryStream.cs
- TextTreeRootNode.cs
- DataGridViewCellCollection.cs
- ImageMapEventArgs.cs
- MultiBinding.cs
- _BufferOffsetSize.cs
- SchemaTypeEmitter.cs
- ImageUrlEditor.cs
- FileVersion.cs
- LineVisual.cs
- ListControl.cs
- ChannelPoolSettings.cs
- DocumentGridContextMenu.cs
- Constants.cs
- AssemblyAttributesGoHere.cs
- XmlNodeList.cs
- Message.cs
- DataGridTextBoxColumn.cs
- PassportAuthentication.cs
- StateMachineDesignerPaint.cs
- Dictionary.cs
- MyContact.cs
- IteratorFilter.cs
- FixedLineResult.cs
- WindowsNonControl.cs
- smtppermission.cs
- UniqueIdentifierService.cs
- Root.cs
- HandlerBase.cs
- Tool.cs
- ExtendedProtectionPolicy.cs
- HtmlElement.cs
- DataGridViewCellCancelEventArgs.cs
- StreamGeometry.cs
- ConstNode.cs
- PathGeometry.cs
- WebConfigurationHost.cs
- DataGridViewSortCompareEventArgs.cs
- CustomAttributeFormatException.cs
- ItemCollection.cs
- TextTreeExtractElementUndoUnit.cs
- RuntimeArgumentHandle.cs
- QilSortKey.cs
- AnimationStorage.cs
- DataKey.cs
- HttpTransportElement.cs
- ChannelDispatcher.cs
- ValidatedMobileControlConverter.cs
- ExtensibleClassFactory.cs
- AtomServiceDocumentSerializer.cs
- ImageSourceValueSerializer.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- FactoryMaker.cs
- SecurityKeyUsage.cs
- ExpandCollapsePattern.cs
- WebPartMinimizeVerb.cs
- ClientEventManager.cs
- EntityProviderServices.cs
- FormsAuthenticationUser.cs
- AsyncCodeActivityContext.cs
- PipeStream.cs
- ObjectSet.cs
- DBDataPermission.cs
- DupHandleConnectionReader.cs
- DataGridItemAttachedStorage.cs
- CompModSwitches.cs
- DbDataReader.cs
- AssociationSet.cs
- Debug.cs
- TlsSspiNegotiation.cs
- ImageInfo.cs
- Help.cs
- HttpContext.cs
- GridViewHeaderRowPresenter.cs
- Timer.cs