SqlError.Procedure SqlError.Procedure SqlError.Procedure SqlError.Procedure Property

Definition

Ruft den Namen der gespeicherten Prozedur oder des Remoteprozeduraufrufs (RPC) ab, der diesen Fehler generiert hat.Gets the name of the stored procedure or remote procedure call (RPC) that generated the error.

public:
 property System::String ^ Procedure { System::String ^ get(); };
public string Procedure { get; }
member this.Procedure : string
Public ReadOnly Property Procedure As String

Eigenschaftswert

Der Name der gespeicherten Prozedur oder des RPCs.The name of the stored procedure or RPC. Weitere Informationen zu Fehlern, die von SQL Server generiert, finden Sie unter Datenbank-Engine-Fehler und Ereignisse.For more information on errors generated by SQL Server, see Database Engine Events and Errors.

Beispiele

Das folgende Beispiel zeigt die einzelnen SqlError innerhalb der SqlErrorCollection Auflistung.The following example displays each SqlError within the SqlErrorCollection collection.

public void DisplaySqlErrors(SqlException exception)
{
	for (int i = 0; i < exception.Errors.Count; i++)
	{
		Console.WriteLine("Index #" + i + "\n" +
			"Source: " + exception.Errors[i].Source + "\n" +
			"Number: " + exception.Errors[i].Number.ToString() + "\n" +
			"State: " + exception.Errors[i].State.ToString() + "\n" +
			"Class: " + exception.Errors[i].Class.ToString() + "\n" +
			"Server: " + exception.Errors[i].Server + "\n" +
			"Message: " + exception.Errors[i].Message + "\n" +
			"Procedure: " + exception.Errors[i].Procedure + "\n" +
			"LineNumber: " + exception.Errors[i].LineNumber.ToString());
	}
	Console.ReadLine();
}
Public Sub DisplaySqlErrors(ByVal exception As SqlException)
    Dim i As Integer

    For i = 0 To exception.Errors.Count - 1
        Console.WriteLine(("Index #" & i & ControlChars.NewLine & _
            "Source: " & exception.Errors(i).Source & ControlChars.NewLine & _
            "Number: " & exception.Errors(i).Number.ToString() & ControlChars.NewLine & _
            "State: " & exception.Errors(i).State.ToString() & ControlChars.NewLine & _
            "Class: " & exception.Errors(i).Class.ToString() & ControlChars.NewLine & _
            "Server: " & exception.Errors(i).Server & ControlChars.NewLine & _
            "Message: " & exception.Errors(i).Message & ControlChars.NewLine & _
            "Procedure: " & exception.Errors(i).Procedure & ControlChars.NewLine & _
            "LineNumber: " & exception.Errors(i).LineNumber.ToString()))
    Next i
    Console.ReadLine()
End Sub

Gilt für:

Siehe auch