Compartir a través de


SqlDataDictionaryPermission.newmethod(String) Method

Definition

Creates a new instance of the SQLDataDictionaryPermission class.

public:
 void newmethod(System::String ^ _methodName);
public void newmethod (string _methodName);
override this.newmethod : string -> unit
Public Sub newmethod (_methodName As String)

Parameters

_methodName
String

The string that represents the name of the method to be called.

Remarks

The following code example deletes the data in the xRefNames table.

server static void main(Args _args) 
{ 
    DictTable dictTable = new DictTable(tablenum(xRefNames)); 
    str sqlTableName; 
    SqlDataDictionary sqlTable; 
    if (dictTable && dictTable.enabled()) 
    { 
        sqlTableName = dictTable.name(DbBackend::Sql); 
        sqlTable = new SqlDataDictionary(); 
        // Only try to truncate if the table does exist 
        // in the SQL database 
        if (sqlTable.tableExist(sqlTableName)) 
        { 
            new SqlDataDictionaryPermission( 
                methodstr(SqlDataDictionary, tableTruncate)).assert(); 
            sqlTable.tableTruncate(tablenum(xRefNames)); 
            CodeAccessPermission::revertAssert(); 
        } 
    } 
}

Applies to