Example #1
0
        public static void Do()
        {
            //var tables = ITPCfSQL.Azure.Internal.JSON.InternalMethods.QueryTables(
            //    "enosg", "secret", true);

            //var ret= ITPCfSQL.Azure.Internal.JSON.InternalMethods.QueryTable(
            //    "enosg", "secret", true,
            //    "HaOnAzureEndpoint");

            //var tables = ITPCfSQL.Azure.Internal.InternalMethods.CreateTable(
            //    "enosg", "secret", true, "testvs");

            ITPCfSQL.Azure.AzureTableService ats = new ITPCfSQL.Azure.AzureTableService("enosg", "secret", true);
            var lTables = ats.ListTables();

            var table = lTables.FirstOrDefault(item => item.Name == "testload");

            if (table == null)
            {
                table = ats.CreateTable("testload");
            }

            //table.Drop();

            #region Load data
            System.Console.WriteLine("Data load...");
            List <string> lItems = new List <string>();
            using (System.IO.StreamReader sr = new System.IO.StreamReader(
                       new System.IO.FileStream("C:\\temp\\SacramentocrimeJanuary2006.csv", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read)))
            {
                string str;
                while ((str = sr.ReadLine()) != null)
                {
                    lItems.Add(str);
                }
            }
            System.Console.WriteLine("Data load completed.");
            #endregion

            // Go Channel!
        }
Example #2
0
        public static void Do()
        {
            //var tables = ITPCfSQL.Azure.Internal.JSON.InternalMethods.QueryTables(
            //    "enosg", "secret", true);

            //var ret= ITPCfSQL.Azure.Internal.JSON.InternalMethods.QueryTable(
            //    "enosg", "secret", true,
            //    "HaOnAzureEndpoint");

            //var tables = ITPCfSQL.Azure.Internal.InternalMethods.CreateTable(
            //    "enosg", "secret", true, "testvs");

            ITPCfSQL.Azure.AzureTableService ats = new ITPCfSQL.Azure.AzureTableService("enosg", "secret", true);
            var lTables = ats.ListTables();

            var table = lTables.FirstOrDefault(item => item.Name == "testload");
            if (table == null)
                table = ats.CreateTable("testload");

            //table.Drop();

            #region Load data
            System.Console.WriteLine("Data load...");
            List<string> lItems = new List<string>();
            using (System.IO.StreamReader sr = new System.IO.StreamReader(
                new System.IO.FileStream("C:\\temp\\SacramentocrimeJanuary2006.csv", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read)))
            {
                string str;
                while ((str = sr.ReadLine()) != null)
                    lItems.Add(str);
            }
            System.Console.WriteLine("Data load completed.");
            #endregion

            // Go Channel!
        }
Example #3
0
 public Table(AzureTableService AzureTableService, string Name)
 {
     this.AzureTableService = AzureTableService;
     this.Name = Name;
     Url = GenerateUriFromParameters(this);
 }
Example #4
0
 public Table(AzureTableService AzureTableService, string Name)
 {
     this.AzureTableService = AzureTableService;
     this.Name = Name;
     Url       = GenerateUriFromParameters(this);
 }