/// <include file='..\..\..\..\..\..\..\doc\snippets\Microsoft.Data.SqlClient\SqlParameterCollection.xml' path='docs/members[@name="SqlParameterCollection"]/RemoveValue2/*' /> override public void Remove(object value) { OnChange(); // fire event before value is validated ValidateType(value); int index = IndexOf(value); if (-1 != index) { RemoveIndex(index); } else if (this != ((SqlParameter)value).CompareExchangeParent(null, this)) { throw ADP.CollectionRemoveInvalidObject(ItemType, this); } }
override public void Remove(object value) { OnChange(); SqlParameter castedValue = ValidateType(value); int index = InnerList.IndexOf(castedValue); if (-1 != index) { RemoveIndex(index); } else if (this != ((SqlParameter)value).CompareExchangeParent(null, this)) { throw ADP.CollectionRemoveInvalidObject(typeof(SqlParameter), this); } }
public override void Remove(object value) { OnChange(); ValidateType(value); int index = IndexOf(value); if (-1 != index) { RemoveIndex(index); } else if (this != ((OleDbParameter)value).CompareExchangeParent(null, this)) { throw ADP.CollectionRemoveInvalidObject(s_itemType, this); } }
/// <include file='doc\OleDbParameterCollection.uex' path='docs/doc[@for="OleDbParameterCollection.Remove"]/*' /> public void Remove(object value) { OnSchemaChanging(); // fire event before value is validated ValidateType(value); int index = IndexOf((OleDbParameter)value); if (-1 != index) { RemoveIndex(index); } else { throw ADP.CollectionRemoveInvalidObject(ItemType, this); } }