COM CleanUp when using IXSSO in .Net

I am using IXSSO to access Index Server similar to described in  article  Query Index Server with IXSSO in .NET” on  ASP101. (See also my post how to use Fill Dataset with rows in a specified range  http://thespoke.net/blogs/mnf/archive/2005/05/09/92495.aspx).

Recently I found a useful tip to dispose COM objects after the use. I noticed that  it is required to check for null before calling ReleaseComObject. So the finally section should be like this

finally

{ // recommended in http://www.eggheadcafe.com/forumarchives/inetserverindexserver/Aug2005/post23479438.asp

if (rs!=null)Marshal.ReleaseComObject(rs); //Recordset

if (query!=null)Marshal.ReleaseComObject(query); //Query

if (util!=null)Marshal.ReleaseComObject(util); //Utils

query = null;

util = null;

rs=null;

}

 

posted @ Friday, September 23, 2005 8:56 AM

Print

Comments on this entry:

# Indexing catalog doesn't return aliased path if single directory is added to scope.

Left by Michael Freidgeim at 12/1/2006 11:20 AM
Gravatar
See also Indexing catalog doesn't return aliased path if single directory is added to scope http://geekswithblogs.net/mnf/articles/100092.aspx

Your comment:



 (will not be displayed)


 
 
 
Please add 6 and 4 and type the answer here:
 

Live Comment Preview:

 
«September»
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011