I want my Azure application to create a blob and write a data into it. When I tried it I got this exception stating that
ArgumentException was unhandled
Stream was not writable
here is my code
var ms = new MemoryStream();
for (int k = 0; k < 10; k++)
{
using (StreamWriter sw = new StreamWriter(ms))
{
string val = k.ToString();
if (k + 1 != len)
val = val + " ";
sw.Write(val);
sw.Flush();
}
}
ms.Position = 0;
blob.UploadFromStream(ms);
My code is getting executed for k = 0. The exception is thrown when k = 1. Can anyone tell me how to solve this exception
Moreover, Is this the correct procedure for writing onto the blob. If no, where am I went wrong and how to correct it.