VKinfotek Inc.
  • Us
    About Us
    Contact Us
  • FAQs
  • Ready Software
    Ready ERP ASP Core Software for Azure Cloud
    Ready Web ERP Software
    Ready ASP.Net Azure Software
    Ready C# SQL Server Accounting Software
    Ready ASP.Net MVC and EF Software
First slide
Earn $100/hour in USA! Click Here

Q84. How to insert multiple records in a transaction using TableBatchOperation?

As you know, Azure Table Storage supports entity batch transactions to manage multiple entities in a single transaction. Assume you’re trying to insert some entities in an Azure table using entity batch transaction. The following code example creates three entity objects and adds each to a TableBatchOperation using the Insert method. Then CloudTable.Execute is called to execute the operation.

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    CloudConfigurationManager.GetSetting("StorageConnectionString"));

CloudTableClient cloudTableClient = storageAccount.CreateCloudTableClient();

var customer = new CustomerEntity()
{
    FirstName = "John",  LastName = "wayne"
};

CloudTable table = cloudTableClient.GetTableReference(tableName);

TableBatchOperation batchOperation = new TableBatchOperation();

batchOperation.Insert(customer);

customer = new CustomerEntity()
{
    FirstName = "Chris", LastName = "Gayle"
};

batchOperation.Insert(customer);

customer = new CustomerEntity()
{
    FirstName = "Marlon",   LastName = "Brando"
};

batchOperation.Insert(customer);
table.ExecuteBatch(batchOperation);


  • Prev Question
  • Next Question

See More Questions and Answers on - Azure Blobs and Queues

  • Partitions and Queries?
  • Partition size in Azure table storage?
  • What are the typical query types for table storage?
  • Explain blobs data model?
  • How to address resources in the storage emulator?
  • Configure a .Net application for using storage emulator?
  • How to create a container and upload a blob using the server explorer?
  • How to use the windows azure blob storage service in .net?
  • Key benefits of SQL database service?

Back to Master List of 100+ Questions and Answers

People also viewed: cover image of book develop erp software using asp core and deploy to Azure Create your own ERP Software using ASP Core>>
cover image of azure cloud book Create your own Azure SOM Software>>
cover image of asp.net book Create your own ERP Software using ASP .Net and SQL>>
cover image of foundation database programming book Create your own Accounting Software using C# >>
cover image of entity framework book Create your own SOM using Entity Framework MVC >>

  • SITEMAP
  • Terms of use
  • Testimonials

Back to top

Copyright © 2018 - All Rights Reserved - VKInfotek.com