0

Closed

SQL Engine: Programmability: CLR:HandlingLOBUsingCLR:CS: There are Warnings in the Code Analysis resuts.

description

Environment:

1. Win2k3 ENT ENU
2. Yukon DEV ENU 09.06.2031.00, Sample MSI 62013
3. Whidbey 8.0.50727.42

Steps:

1.Open the CS solution file "...\CS\" in Whidbey
2.Execute code analysis from the menu: Build -> Run Code Analysis on
  1. Check the analysis results.

Expections:

The analysis results should be "0 Error, 0 Warning, 0 Messages"

Actual Results:

There are Warnings. Details are as follows:
Warning 1 CA2000 : Microsoft.Reliability : Modify LargeObjectBinary.GetPhotoFromDB(Int32, String, String):Void to dispose local 'conn' of type 'SqlConnection' for all code paths. C:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\HandlingLOBUsingCLR\CS\HandlingLOBUsingCLR\LargeObjectBinary.cs 149 HandlingLOBUsingCLR
Closed Jul 17, 2009 at 6:15 AM by leilu

comments

wrote Apr 28, 2009 at 4:43 AM

Added the followed code in line 148 of LargeObjectBinary.cs
//dispose the conn                if (conn != null)                {                    conn.Close();                    conn.Dispose();                }

wrote Jul 17, 2009 at 6:15 AM

Verified on Sample Build 90714