SqlExecutionException.SqlFile 属性

定义

获取异常发生时包含正在运行的 SQL 命令的文件的路径和名称。Gets the path and name of the file containing the SQL commands being run when the exception occurred.

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

属性值

String

异常发生时包含正在运行的 SQL 命令的文件的路径和名称。The path and name of the file that contains the SQL commands being run when the exception occurred.

示例

下面的代码示例演示如何访问 SqlFile SqlExecutionException 异常类型的属性。The following code example shows how to access the SqlFile property of the SqlExecutionException exception type. 此代码示例是为类提供的更大示例的一部分 SqlServicesThis code example is part of a larger example provided for the SqlServices class.

Console.WriteLine("  SqlFile: {0}",
    sqlExecutionException.SqlFile);
Console.WriteLine("  SqlFile: {0}", _
    sqlExecutionException.SqlFile)

适用于