1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
8 namespace System
.Data
.SqlClient
10 partial class SqlException
12 private const string DEF_MESSAGE
= "SQL Exception has occured.";
14 public override string Message
{
16 if (Errors
.Count
== 0)
18 StringBuilder result
= new StringBuilder ();
19 if (base.Message
!= DEF_MESSAGE
) {
20 result
.Append (base.Message
);
23 for (int i
= 0; i
< Errors
.Count
-1; i
++) {
24 result
.Append (Errors
[i
].Message
);
27 result
.Append (Errors
[Errors
.Count
- 1].Message
);
28 return result
.ToString ();