ModelComponentCollection.GetItem Method
SQL Server 2008 R2
Gets a reference to the specified component.
Assembly: Microsoft.AnalysisServices (in Microsoft.AnalysisServices.dll)
protected IModelComponent GetItem( string key, bool throwIfNotFound, string keyPropertyName )
Parameters
- key
- Type: System.String
The key of the IModelComponent to get from the ModelComponentCollection.
- throwIfNotFound
- Type: System.Boolean
true if ItemNotFoundException should be thrown if the key is not found in the ModelComponentCollection;otherwise, false.
- keyPropertyName
- Type: System.String
The name of the IModelComponent property that provides key values.
Return Value
Type: Microsoft.AnalysisServices.IModelComponentThe IModelComponent that has the specified key.
| Exception | Condition |
|---|---|
| ItemNotFoundException | throwIfNotFound is set to false and one of the following conditions occurs: key contains a null reference (Nothing in Visual Basic.) -or- key cannot be found in the ModelComponentCollection. |
