how to write data to azure storage tables
-
25-09-2019 - |
Question
I have data which needs to be written to azure storage tables. Can someone point me to a blog or msdn article where I can refer the sample code? Help me proceed beyond the 4th line of code.
string tableName = "myTable";
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.FromConfigurationSetting("ConnectionString");
CloudTableClient cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
cloudTableClient.CreateTableIfNotExist(tableName);
Solution
Take a look at the Azure Platform Training Kit. In particular, look at the lab called ExploringWindowsAzureStorageVS2010. That lab will walk you through creating a table entity, creating a table context, and code to insert into table storage, including the use of AddObject() and SaveChanges() to write your entities to a table.
OTHER TIPS
I also found a good blog at http://www.geekzone.co.nz/vs2008/6311
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow