Nota
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare ad accedere o modificare le directory.
L'accesso a questa pagina richiede l'autorizzazione. È possibile provare a modificare le directory.
Si verifica quando un'operazione esterna di convalida o di dati-analisi genera un'eccezione, o quando eseguire il commit dei dati a un'origine dati ha esito negativo.
Spazio dei nomi: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintassi
'Dichiarazione
Public Event DataError As DataRepeaterDataErrorEventHandler
public event DataRepeaterDataErrorEventHandler DataError
public:
event DataRepeaterDataErrorEventHandler^ DataError {
void add (DataRepeaterDataErrorEventHandler^ value);
void remove (DataRepeaterDataErrorEventHandler^ value);
}
member DataError : IEvent<DataRepeaterDataErrorEventHandler,
DataRepeaterDataErrorEventArgs>
JScript non supporta gli eventi.
Note
DataError l'evento consente di gestire le eccezioni generate nel codice chiamato dal controllo durante le operazioni di elaborazione dati.
per ulteriori informazioni su come gestire gli eventi, vedere Utilizzo degli eventi.
Esempi
Nell'esempio di codice seguente viene illustrato un oggetto DataError gestore eventi.
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
private void dataRepeater1_DataError(object sender,
Microsoft.VisualBasic.PowerPacks.DataRepeaterDataErrorEventArgs e)
{
string ErrorMsg;
// Create an error string.
ErrorMsg = "Invalid value entered for " + e.Control.Name + ". ";
ErrorMsg = ErrorMsg + e.Exception.Message;
// Display the error to the user.
MessageBox.Show(ErrorMsg);
// Do not raise an exception.
e.ThrowException = false;
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per ulteriori informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Spazio dei nomi Microsoft.VisualBasic.PowerPacks