I am attempting to download a csv file from Azure container blob, read and load it to a dataset and then bind it to the radgrid.
I can download the data and set it to a string (the sample data is listed below) but not sure how to load it to the dataset.
When I load the data to a stream and then try to load it to a dataset, I received the following error: "Data at the root level is invalid. Line 1, position 1."
Here is a sample of the Data that is in the file ( I also tried it with no hdr record, same results...)
1001,Presidents,6220,FT Senior Administrator,1,126000
1001,Presidents,6221,FT Professional Staff,1,105050
Here is my source code....
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("hsc2");
// Retrieve reference to a blob named "myblob".
CloudBlockBlob blockBlob = container.GetBlockBlobReference(FileUpload1.FileName);
//...Create or overwrite the "myblob" blob with contents from a local file.
using (var memoryStream = new MemoryStream())
memoryStream.Position = 0;
StreamReader streamReader = new StreamReader(memoryStream);
//String blobText = streamReader.ReadToEnd();
DataSet ds1 = new DataSet();
RadGrid1.DataSource = ds1;