Microsoft Knowledge Base Email Alertz

KBAlertz.com: (884871) - Fixes a problem where the .NET Framework 1.0 and the .NET Framework 1.1 return an empty string for the Server property of the SQLException object.

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 884871 - Last Review: June 1, 2006 - Revision: 4.2

FIX: The Server property may return as an empty string when you receive the SQLException object in the .NET Framework 1.0 and in the .NET Framework 1.1

On This Page

SYMPTOMS

You can use the Microsoft .NET Framework 1.0 and the .NET Framework 1.1 to create an instance of the SQLConnection class on the computer that is running Microsoft SQL Server 2000. However, if the SqlException object is raised, the Server property of the SqlException object is not set. The Server property returns an empty string. The Server property is supposed to contain the name of the instance of the computer that is running SQL Server that the associated SqlConnection class is connected to.

RESOLUTION

How to obtain the hotfix

This issue is fixed in the Microsoft Visual Studio .NET Hotfix Package 3151. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
887549  (http://kbalertz.com/Feedback.aspx?kbNumber=887549/ )

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Steps to reproduce the problem

Use the following C# code sample to create a console application to reproduce the problem.
SqlConnection nwindConn = new SqlConnection("Data Source=server;uid=uid;pwd=pwd;");

SqlCommand salesCMD = new SqlCommand("dbo.prc_not_a_real_sproc", nwindConn);
salesCMD.CommandType = CommandType.StoredProcedure;

try
{
    nwindConn.Open();
    salesCMD.ExecuteReader();
}
catch(SqlException ex)
{
    Console.WriteLine("SqlExceptionServer=" + ex.Server);
    foreach (SqlError sqlError in ex.Errors)
    {
        Console.WriteLine("SqlError Server: " + sqlError.Server);
    }
}
Console.Read();

APPLIES TO
  • Microsoft .NET Framework 1.0
  • Microsoft .NET Framework 1.1
Keywords: 
kbtshoot kbbug kbfix kbqfe kbhotfixserver KB884871
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please