2

以下は、Azure テーブルからデータを取得するために使用されるコードです。

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConnectionString);
 CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
 TableServiceContext serviceContext = tableClient.GetDataServiceContext();
 CloudTableQuery<Customer> partitionQuery =
                (from e in serviceContext.CreateQuery<Customer>("Customer")
                 select e).AsTableServiceQuery<Customer>();

// Loop through the results, displaying information about the entity
   foreach (Customer entity in partitionQuery)
   {
        CustomerList.Add(entity);
   }

すべてが正常に機能していました。突然、上記の呼び出しで何も返されないことがわかりました。ServiceContext を取得できます。"Fidler"そして、ツールを使用してトラブルシューティングを試みました。実際には、データはクラウド テーブルから取得されています (これは、Fidler のクエリ応答で確認できました)。しかし、"partitionQuery"オブジェクトを反復すると、データなしで返されます。同じコードが他のマシンでも機能します。使用する Azure SDK は他のマシンでも同じです。誰でもこれについて助けることができますか?ありがとう。

更新:現在、新しいバージョンの Azure SDK を使用しています。(2012 年 10 月) これは問題になる可能性がありますか?

4

2 に答える 2

1

私は同じ問題を経験しました。パーティション キー (またはその他のクエリ) を指定すると、問題なく動作します。

rangeQuery = new TableQuery<PhotoEvent>().Where(TableQuery.GenerateFilterConditionForBool("active", QueryComparisons.Equal, true));
于 2012-11-24T06:04:11.820 に答える
1

2012 年 10 月の Azure SDK を使用している場合は、次のように変更します。

TableServiceContext serviceContext = tableClient.GetDataServiceContext();

CloudTableQuery<Customer> partitionQuery = (from e in serviceContext.CreateQuery<Customer>("Customer")
select e).AsTableServiceQuery<Customer>();

TableServiceContext serviceContext = tableClient.GetTableServiceContext();

TableServiceQuery<Customer > partitionQuery = (from e in serviceContext.CreateQuery<Customer>(“Customer”)
                                                               select e).AsTableServiceQuery(serviceContext);

注:破壊的変更の詳細なリストを参照してください。

Microsoft.WindowsAzure.Storage.Table.DataServicesまた、名前空間が含まれていることを確認してください。

それでも予期しない動作が見られる場合は、さらに調査できるように、フィドラー トレースを (電子メールで) 提供してください。

于 2012-11-26T21:09:55.977 に答える