BindingError Event

Microsoft Office Web Components Visual Basic

BindingError Event

Occurs after an error is received from the data source following a call to Refresh or Update method operation.

Private Sub Spreadsheet1_BindingError(BindingId, Action, DialogText, FaultCode, FaultString, FaultDetail)

BindingId    Required String. The unique ID of an XmlDataBinding object. The unique BindingId    is automatically generated by the Spreadsheet component when you bind to a data retrieval service connection (.uxdc) file. Microsoft Excel also automatically generates the BindingId    when you use Excel to create a data-bound spreadsheet and later save it as an XML Spreadsheet file. In the XML Spreadsheet file, the XML fragment that contains the BindingId    looks something like the following:
<x2:Binding x2:ID="Bind_id89929" x2:LoadMode="normal" x2:Async="False">.
You can also manually assign a BindingId    value by adding the relevant XML fragment that contains data-binding details into an XML Spreadsheet file.

Action   Required String. Refers to the type of binding operation that was completed. The possible values are "Refresh" and "Update".

DialogText   Required String. Refers to the error string mapped to the fault code received.

FaultCode   Required String. Corresponds to the <FaultCode> element in the fault message — for example, "Client.Dsp.Authentication".

FaultString   Required String. Corresponds to the <FaultString> element in the fault message — for example, "Can't logon user <username>".

FaultDetail   Required String. Corresponds to the <Detail> element in the fault message — for example, <dsp:queryResponse status="failure" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp"> </dsp:queryResponse> <dsp:author>authorName</dsp:author> These strings match the structure of data retrieval service connection SOAP fault messages.

Remarks

For XML Spreadsheet files and part-to-part bindings, the DialogText error string will be present in the fault message but not in the FaultCode, FaultString and FaultDetail parameters. For arbitrary SOAP bindings, FaultCode and FaultString are returned by all XML Web services fault messages —  but the optional element FaultDetail is not returned by most XML Web services, including data retrieval services.

When a Refresh or Update method fails, the BindingError event fires and an error dialog box is displayed. To catch the error in script, solution developers should trap the BindingError event. The error won't be returned by the Refresh or Update methods or by Internet Explorer. When Refresh or Update is called on an asynchronous binding, these methods return immediately.

Solution developers should trap the BindingCompleted and BindingError events to find out when the binding is finished. Note that using the BindingCompleted event to select an XML row does not send that row to a part-to-part binding consumer when the page is loaded. Use the Window.Onload event for this purpose.