Amazon DynamoDB
入门指南 (API Version 2012-08-10)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。点 击 Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

步骤 5:(可选) 删除表

删除 Movies 表:

  1. 将以下程序复制到 Program.cs 文件中,替代其当前内容。

    using System; using System.Text; using Amazon.DynamoDBv2; using Amazon.DynamoDBv2.Model; namespace DynamoDB_intro { class Program { static void Main(string[] args) { // Get an AmazonDynamoDBClient for the local DynamoDB database AmazonDynamoDBClient client = GetLocalClient(); try { client.DeleteTable("Movies"); } catch (Exception ex) { Console.WriteLine("\n Error: the \'Movies\" table could not be deleted!\n Reason: " + ex.Message); Console.Write("\n\n ...Press any key to continue"); Console.ReadKey(); Console.WriteLine(); return; } Console.WriteLine("\n Deleted the \'Movies\" table successfully!"); } public static AmazonDynamoDBClient GetLocalClient() { // First, set up a DynamoDB client for DynamoDB Local AmazonDynamoDBConfig ddbConfig = new AmazonDynamoDBConfig(); ddbConfig.ServiceURL = "http://localhost:8000"; AmazonDynamoDBClient client; try { client = new AmazonDynamoDBClient(ddbConfig); } catch (Exception ex) { Console.WriteLine("\n Error: failed to create a DynamoDB client; " + ex.Message); return (null); } return (client); } } }
  2. 编译并运行程序。