【问题标题】:Azure Table Insert row into TableServiceContextAzure Table 将行插入 TableServiceContext
【发布时间】:2012-05-03 03:35:58
【问题描述】:

[进入天蓝色表菜鸟] 我能找到的所有关于 Azure 表存储的文章都在 Microsoft.WindowsAzure.StorageClient 中指定了与 TableServiceContext 类相关的 AddObject 方法。不幸的是,当我尝试引用 AddObject 和 SaveChanges 方法时,VS 说没有这样的方法。这是我的代码:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
                    RoleEnvironment.GetConfigurationSettingValue("StorageConnectionString")
                );

CloudTableClient tableClient = new CloudTableClient(storageAccount.TableEndpoint.ToString(), storageAccount.Credentials);
                tableClient.CreateTableIfNotExist("ODATImageResizeErrors");

TableServiceContext context = tableClient.GetDataServiceContext();

ImageResizeErrorEntity entity = new ImageResizeErrorEntity();

entity.ErrorDescription = "Error resizing image";
entity.InnerException = ex.InnerException.ToString();
entity.ImageTypeId = imageTypeId;
entity.SkuId = skuId;
entity.RowKey = Guid.NewGuid().ToString();
entity.PartitionKey = "Errors";

这是我收到的完整错误:

感谢您的帮助 P.S.:我确实确保我的 Windows Azure SDK 是最新的,我的 StorageClient DLL 是 v1.1.0.0

【问题讨论】:

    标签: azure cloud azure-table-storage


    【解决方案1】:

    您有对 System.Data.Services.Client.dll 的引用和它的 using 声明吗?

    【讨论】:

    • 太棒了!谢谢...我找到的文档没有为该库指定参考,而且我不知道它依赖于该标准库...成功了。
    猜你喜欢
    • 1970-01-01
    • 2012-01-25
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 2018-01-31
    • 1970-01-01
    • 2021-08-30
    • 1970-01-01
    相关资源
    最近更新 更多