Disconnect()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Add On > Connection >

Disconnect()

Previous page Return to chapter overview Next page

Definition

Disconnects from the data connection.

 

Syntax

<Connection>.Disconnect()

 

 

Example

ns

private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
{
  // If an execution triggers after 9pm, disconnect from the account's data source
  if (e.Time > new DateTime(now.Year, now.Month, now.Day, 21, 0, 0))
      myAccount.Connection.Disconnect();
}