(0) exportieren Drucken
Alle erweitern
Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

CloudTableClient.BeginDeleteTableIfExist-Methode

Begins an asynchronous operation to delete the tables if it exists.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in microsoft.windowsazure.storageclient.dll)
'Usage
Dim instance As CloudTableClient
Dim tableName As String
Dim callback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginDeleteTableIfExist(tableName, callback, state)
public IAsyncResult BeginDeleteTableIfExist (
	string tableName,
	AsyncCallback callback,
	Object state
)
public IAsyncResult BeginDeleteTableIfExist (
	String tableName, 
	AsyncCallback callback, 
	Object state
)
public function BeginDeleteTableIfExist (
	tableName : String, 
	callback : AsyncCallback, 
	state : Object
) : IAsyncResult

Parameter

tableName

The table name.

callback

The callback delegate that will receive notification when the asynchronous operation completes.

state

A user-defined object that will be passed to the callback delegate.

Rückgabewert

An IAsyncResult that references the asynchronous operation.

The following code example deletes a table asynchronously if it exists.

public static void DeleteTableIfExistsAsync(CloudStorageAccount storageAccount)
{
    // Create service client for credentialed access to the Table service.
    CloudTableClient tableClient = new CloudTableClient(storageAccount.TableEndpoint.ToString(),
        storageAccount.Credentials);

    tableClient.BeginDeleteTable("Categories", DeleteTableIfExistsAsyncCallback, tableClient);
}

public static void DeleteTableIfExistsAsyncCallback(IAsyncResult result)
{
    CloudTableClient tableClient = (CloudTableClient)result.AsyncState;

    // End the operation.
    if (tableClient.EndDeleteTableIfExist(result))
    {
        Console.WriteLine("Table deleted.");
    }
    else
    {
        Console.WriteLine("Table does not exist and so could not be deleted.");
    }
}


When a table is successfully deleted, it is immediately marked for deletion and is no longer accessible to clients. The table is later removed from the Table service during garbage collection.

Note that deleting a table is likely to take at least 40 seconds to complete. If an operation is attempted against the table while it was being deleted, a StorageClientException is thrown, with additional error information indicating that the table is being deleted.


Alle öffentlichen statischen (freigegebenen in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Entwicklungsplattformen

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 und Windows 2000

Zielplattformen

Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
Vielen Dank für Ihr Feedback.

Community-Beiträge

Anzeigen:
© 2014 Microsoft. Alle Rechte vorbehalten.