Refreshing a Collection

When you use the Refresh collection method, SQL-DMO refreshes objects with current information from SQL Server. The Refresh method takes a single Boolean parameter, indicating if you want to release all objects in the collection and "under" the collection in the SQL-DMO hierarchy.

Some objects that cache a lot of SQL Server information have a direct Refresh method.

Visual Basic

To use the Refresh collection method, use the following syntax:

Parent.Objects.Refresh ( bRelease )

Do not call Refresh within a For Each loop.

C++

To use the Refresh collection method, use the following syntax:

pObjects->Refresh ( bRelease );