Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

DataRepeater.DataError Event

Occurs when an external data-parsing or validation operation throws an exception, or when an attempt to commit data to a data source fails.

Namespace:  Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks (in Microsoft.VisualBasic.PowerPacks.dll)

public event DataRepeaterDataErrorEventHandler DataError

The DataError event enables you to handle exceptions thrown in code that is called by the control during data processing operations.

For more information about how to handle events, see Consuming Events.

The following code example demonstrates a DataError event handler.

Private Sub DataRepeater1_DataError(ByVal sender As Object, ByVal e _
 As Microsoft.VisualBasic.PowerPacks.DataRepeaterDataErrorEventArgs) _
 Handles DataRepeater1.DataError
    Dim ErrorMsg As String
    ' Create an error string.
    ErrorMsg = "Invalid value entered for " & e.Control.Name & ". "
    ErrorMsg = ErrorMsg & e.Exception.Message
    ' Display the error to the user.
    MsgBox(ErrorMsg)
    ' Do not raise an exception.
    e.ThrowException = False
End Sub

Community Additions

ADD
Show:
© 2015 Microsoft