title: List all azure tables in a storage account
body: <p>I am trying to list all azure tables and then iterate over them to delete each table. Here first I get list of all cloud tables and then trying to iterate over all cloud tables. But it gives me exception on lopping over it.</p>
  
  <p>Code is as follows</p>
  
  <pre><code>CloudStorageAccount account = CloudStorageAccount.Parse(connectionString);
  CloudTableClient tableClient;
  IEnumerable&lt;CloudTable&gt; tables = tableClient.ListTables();
  foreach (CloudTable table in tables)
                  table.DeleteIfExists();
  </code></pre>
  
  <p>At for loop is breaks and does not allows to iterate. Below is the exception details.</p>
  
  <blockquote>
    <p>at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](StorageCommandBase<code>1 cmd, IRetryPolicy policy, OperationContext operationContext)
        at Microsoft.WindowsAzure.Storage.Table.TableQuery</code>1.ExecuteQuerySegmented(TableContinuationToken token, CloudTableClient client, String tableName, TableRequestOptions requestOptions, OperationContext operationContext)
        at Microsoft.WindowsAzure.Storage.Table.TableQuery<code>1.&lt;&gt;c__DisplayClass7.&lt;Execute&gt;b__6(IContinuationToken continuationToken)
        at Microsoft.WindowsAzure.Storage.Core.Util.CommonUtility.&lt;LazyEnumerable&gt;d__0</code>1.MoveNext()
        at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
        at CleanStorageAccount.Program.Main(String[] args) in c:\Users\vargup\Documents\Visual Studio 2013\Projects\CleanStorageAccount\CleanStorageAccount\Program.cs:line 34
        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
        at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
        at System.Threading.ThreadHelper.ThreadStart()</p>
  </blockquote>