編輯

共用方式為


Errors.Delete(Object, String) Method

Definition

Deletes the specified ErrorObject object from the ErrorsCollection collection.

public:
 void Delete(System::Object ^ varNode, System::String ^ bstrConditionName);
public void Delete (object varNode, string bstrConditionName);
abstract member Delete : obj * string -> unit
Public Sub Delete (varNode As Object, bstrConditionName As String)

Parameters

varNode
Object

The XML Document Object Model (DOM) node associated with the error.

bstrConditionName
String

The name of the error.

Examples

//Delete the errors associated with a specific node
IXMLDOMDocument myDOM = thisXDocument.DOM;
IXMLDOMNode myNode = myDOM.selectSingleNode("my:myFields/my:aGroup/my:field1");
thisXDocument.Errors.<span class="label">Delete</span>(myNode,thisXDocument.Errors[0].ConditionName.ToString());

Remarks

The Delete method deletes all the Error objects in the Errors collection that are associated with the specified XML node and that have the same name. To delete all of the Error objects contained in the Errors collection, use the DeleteAll() method.

Note: The Delete method will only delete errors that were created using the Add(Object, String, String, String, Int32, String) method. It cannot be used to delete errors that occur because of schema or data validation constraints, or errors that were created using the ReportError(Object, String, Boolean, String, Int32, String) method.

Applies to