Remove a Item Attribute via Code

Aug 23, 2009 at 6:59 AM

I tried to remove a Operation Item Attribute by code:

yy.CreateAttribute("John", "Helo")"John")

yy.Attributes.Remove("John")

<font size="2">

yy.Attributes.Clear()

</font>

 

When i check the yy.Attributes its remove/cleared OK

When i check via MMC its not removed and "John" still there. So what do i do wrong? Not even the Clear() to remove all attributes on a OperationItem seems to work

Im not sure if this is a general problem or specific to OperationItem Attributes

Regards,

John

 

Coordinator
Aug 23, 2009 at 7:17 AM

Hi John,

the remove method (and the Clear method too) remove the attribute from the Attribute collection but don’t delete it from the Database.

To delete from the DB you must use the Delete method (IAzManAttribute<OWNER> class).

I.e.:

var attribute = yy.CreateAttribute("John", "Helo");

attribute.Delete();

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator  
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com