OdbcInfoMessageEvent.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Data / System / Data / Odbc / OdbcInfoMessageEvent.cs / 1305376 / OdbcInfoMessageEvent.cs

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

namespace System.Data.Odbc {
 
    public delegate void OdbcInfoMessageEventHandler(object sender, OdbcInfoMessageEventArgs e);
 
    public 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