'Declaration Public Sub Clear()
'Usage Dim instance As TdQueryBand instance.Clear()
public void Clear()
public: void Clear();
'Declaration Public Sub Clear()
'Usage Dim instance As TdQueryBand instance.Clear()
public void Clear()
public: void Clear();
In order to remove all the Query Bands that have been defined at the Connection level, the TdQueryBand object must be retrieved from TdConnection.QueryBand, and then Clear is called to clear all Query Bands from the instance of TdQueryBand. When the changes are applied by calling TdConnection.ChangeQueryBand, all of the Query Bands will be removed from the connection to Teradata.
When all Transaction level Query Bands need to be removed, an instance of TdQueryBand is retrieved from TdTransaction.QueryBand, and then Clear is called. The changes are applied to the Transaction when TdTransaction.ChangeQueryBand is called.
static public void ClearQueryBandExample() { TdConnection conn = new TdConnection( @"DataSource=teradata1;UserId=user1;Password=password1;QueryBand='ProxyUser=user1;ApplicationName=app1'"); // The Query Bands specified using the QueryBand connection string attribute // are defined at the Connection level. conn.Open(); // Retrieving the Query Bands from the connection TdQueryBand qb = conn.QueryBand; // Currently the ProxyUser and ApplicationName are the Query Bands // defined on the connection // Removing all Query Bands from the TdQueryBand instance qb.Clear(); // Removing all the Query Bands defined on the connection to Teradata conn.QueryBand = qb; // // Application continue performing its tasks // conn.Close(); }
Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019