2013-05-03 1 views
0

Windows Azure의 테이블 스토리지 개체 ​​목록에서 일괄 삽입을 시도하고 있습니다.Windows에서 테이블 스토리지에 추가 할 루프를 사용하여 일괄 삽입 azure

현재 저장소 에뮬레이터를 사용하고 있습니다. 나는이 오류를 얻을 : 나는 비슷한 문제가 발생 누구나하지만 아무 소용 검색을 시도

"Unexpected response code for operation".

합니다.

PartitionKey = "projects" + CompanyID.toString(); 
RowKey = ProjectID.toString(); 

그것은 다음과 같이 삽입 :

foreach (vProject item in projectList) 
     { 
      TableOperation retrieveOperation = TableOperation.Retrieve<mMultipleSave.ViewProjectEntity>("projects" + CompanyID.toString(), item.ProjectID.ToString()); 

      TableResult retrievedResult = table.Execute(retrieveOperation); 

      if (retrievedResult.Result != null) 
      { 
       mMultipleSave.ViewProjectEntity updateEntity = (mMultipleSave.ViewProjectEntity)retrievedResult.Result; 
       if (!item.isProjectArchived) 
       { 
        //update entity in table storage 
        updateEntity.ProjectClient = item.ClientName; 
        updateEntity.ProjectCompany = item.Company; 
        updateEntity.ProjectName = item.ProjectName; 
        batchUpdateOperation.Replace(updateEntity); 
       } 
       else { 
        //delete project in table storage if it is archived in the database 
        batchDeleteOperation.Delete(updateEntity); 
       } 
      } 
      else //if it does not exist in table storage insert 
      { 
       mMultipleSave.ViewProjectEntity entity = new mMultipleSave.ViewProjectEntity(CompanyID, item.ProjectID); 

       entity.ProjectClient = item.ClientName; 
       entity.ProjectCompany = item.Company; 
       entity.ProjectName = item.ProjectName; 

       batchInsertOperation.Insert(entity); 

      } 
     } 
     if (batchInsertOperation.Count > 0) 
      table.ExecuteBatch(batchInsertOperation); 
     if (batchUpdateOperation.Count > 0) 
      table.ExecuteBatch(batchUpdateOperation); 
     if (batchDeleteOperation.Count > 0) 
      table.ExecuteBatch(batchDeleteOperation); 

그것은 table.ExecuteBatch(batchInsertOperation);

도와주세요에 오류를 가져옵니다

내 키는이 방법으로 설치됩니다.

답변

0

나는이 문제를 해결했다. 에뮬레이터를 포함하여 Windows Azure 도구를 최신 버전으로 업데이트하십시오. 오늘 현재 버전 2.0에 있음

관련 문제