共用方式為


XEStore.CreateSessionFromTemplate 方法

Creates a Session object from template file specified by the fileName parameter.

命名空間:  Microsoft.SqlServer.Management.XEvent
組件:  Microsoft.SqlServer.Management.XEvent (在 Microsoft.SqlServer.Management.XEvent.dll 中)

語法

'宣告
Public Function CreateSessionFromTemplate ( _
    sessionName As String, _
    fileName As String _
) As Session
'用途
Dim instance As XEStore 
Dim sessionName As String 
Dim fileName As String 
Dim returnValue As Session 

returnValue = instance.CreateSessionFromTemplate(sessionName, _
    fileName)
public Session CreateSessionFromTemplate(
    string sessionName,
    string fileName
)
public:
Session^ CreateSessionFromTemplate(
    String^ sessionName, 
    String^ fileName
)
member CreateSessionFromTemplate : 
        sessionName:string * 
        fileName:string -> Session
public function CreateSessionFromTemplate(
    sessionName : String, 
    fileName : String
) : Session

參數

  • fileName
    型別:System.String
    A string value that specifies the name of the file.

傳回值

型別:Microsoft.SqlServer.Management.XEvent.Session
A Session object from template file specified by the fileName parameter.

例外狀況

例外狀況 條件
XEventException

Parameters are wrong, or failed to create session.

XmlException

The template file is malformed.

UnauthorizedAccessException

The template file can't be accessed.

XmlSchemaValidationException

The template file doesn't conform to the schema.

請參閱

參考

XEStore 類別

Microsoft.SqlServer.Management.XEvent 命名空間