Example #1
0
        public static void CreateTemperatureReadingsDataset()
        {
            string datasetName = "Temperature Readings";

            string datasetId = GetDatasetId(datasetName);

            if (datasetId == string.Empty)
            {
                Console.WriteLine("Creating " + datasetName + " dataset...");
                Table tableDef = TemperatureReadings.GetTableDefinition();

                Dataset datasetRequest = new Dataset(datasetName,
                                                     new List <Table> {
                    tableDef
                },
                                                     defaultMode: DatasetMode.PushStreaming);
                datasetId = ((Dataset)pbiClient.Datasets.PostDatasetInGroup(appWorkspaceId, datasetRequest)).Id;
            }
            else
            {
                Console.WriteLine(datasetName + " dataset already exists");
            }

            PopulateTemperatureReadingsDataset(datasetId);
        }
Example #2
0
 private static void PopulateTemperatureReadingsDataset(string datasetId)
 {
     Console.WriteLine();
     Console.Write("Pushing rows");
     while (true)
     {
         var rows = TemperatureReadings.GetNextTemperatureRowset();
         pbiClient.Datasets.PostRows(appWorkspaceId, datasetId, "TemperatureReadings", rows);
         Console.Write(".");
         Thread.Sleep(1000);
     }
 }