Lists all data table names in a Tablestore instance using the .NET SDK.
Prerequisites
Before you begin, ensure that you have:
An initialized client. For more information, see Initialize a Tablestore client
Method description
Synchronous method:
public ListTableResponse ListTable(ListTableRequest request)
Asynchronous method:
public Task<ListTableResponse> ListTableAsync(ListTableRequest request)
Sample code
The following example retrieves all data table names in an instance and prints each name to the console.
try
{
ListTableRequest request = new ListTableRequest();
ListTableResponse response = client.ListTable(request);
foreach (var tableName in response.TableNames)
{
Console.WriteLine(tableName);
}
}
catch (Exception ex)
{
Console.WriteLine($"List tables failed, exception:{ex.Message}");
}