コード例 #1
0
ファイル: Program.cs プロジェクト: dfrandsen/Stratosphere
 private void SelectItems(string selectExpression)
 {
     using (IReader reader = SdbTable.Select(ServiceId, ServiceSecret, selectExpression))
     {
         WriteItems(reader);
     }
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: dfrandsen/Stratosphere
        private void SelectAndSaveItems(string selectExpression, string fileName)
        {
            long writtenCount = 0;

            using (FileStream stream = new FileStream(fileName, FileMode.Create))
            {
                using (XmlWriter writer = XmlWriter.Create(stream))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("Domain");

                    using (IReader reader = SdbTable.Select(ServiceId, ServiceSecret, selectExpression))
                    {
                        writtenCount = WriteItems(-1, writer, reader);
                    }
                }
            }

            Console.WriteLine("{0} saved {1} items {2} bytes", Path.GetFullPath(fileName), writtenCount, new FileInfo(fileName).Length);
        }