OdbcInfoMessageEvent.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / Data / System / Data / Odbc / OdbcInfoMessageEvent.cs / 1 / OdbcInfoMessageEvent.cs

                            //------------------------------------------------------------------------------ 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
// [....]
//----------------------------------------------------------------------------- 
 
using System;
using System.Data; 
using System.Text;

namespace System.Data.Odbc {
 
#if WINFSInternalOnly
    internal 
#else 
    public
#endif 
    delegate void OdbcInfoMessageEventHandler(object sender, OdbcInfoMessageEventArgs e);

#if WINFSInternalOnly
    internal 
#else
    public 
#endif 
    sealed class OdbcInfoMessageEventArgs : System.EventArgs {
        private OdbcErrorCollection _errors; 

        internal OdbcInfoMessageEventArgs(OdbcErrorCollection errors) {
            _errors = errors;
        } 

        public OdbcErrorCollection Errors { 
            get { return _errors; } 
        }
 
        public string Message { // MDAC 84407
            get {
                StringBuilder builder = new StringBuilder();
                foreach(OdbcError error in Errors) { 
                    if (0 < builder.Length) { builder.Append(Environment.NewLine); }
                    builder.Append(error.Message); 
                } 
                return builder.ToString();
            } 
        }

        public override string ToString() {
            // MDAC 84407 
            return Message;
            } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// 
// [....] 
// [....]
//----------------------------------------------------------------------------- 
 
using System;
using System.Data; 
using System.Text;

namespace System.Data.Odbc {
 
#if WINFSInternalOnly
    internal 
#else 
    public
#endif 
    delegate void OdbcInfoMessageEventHandler(object sender, OdbcInfoMessageEventArgs e);

#if WINFSInternalOnly
    internal 
#else
    public 
#endif 
    sealed class OdbcInfoMessageEventArgs : System.EventArgs {
        private OdbcErrorCollection _errors; 

        internal OdbcInfoMessageEventArgs(OdbcErrorCollection errors) {
            _errors = errors;
        } 

        public OdbcErrorCollection Errors { 
            get { return _errors; } 
        }
 
        public string Message { // MDAC 84407
            get {
                StringBuilder builder = new StringBuilder();
                foreach(OdbcError error in Errors) { 
                    if (0 < builder.Length) { builder.Append(Environment.NewLine); }
                    builder.Append(error.Message); 
                } 
                return builder.ToString();
            } 
        }

        public override string ToString() {
            // MDAC 84407 
            return Message;
            } 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK