Sean Haddy
Sean Haddy

Reputation: 1666

Azure Table Insert row into TableServiceContext

[enter azure table noob] All the articles I can find regarding Azure Table Storage specify an AddObject method related to the TableServiceContext class, within Microsoft.WindowsAzure.StorageClient. Unfortuantely, when I try and reference the AddObject and SaveChanges method, VS says there's no such method. Here is my code:

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";

Here's the full error I receive: Table Insert Error

Thanks for your help P.S.: I did make sure my Windows Azure SDK is up to date, my StorageClient DLL is v1.1.0.0

Upvotes: 0

Views: 1055

Answers (1)

dunnry
dunnry

Reputation: 6868

Do you have a reference to System.Data.Services.Client.dll and a using declaration for it?

Upvotes: 2

Related Questions