private void SelectItems(string selectExpression) { using (IReader reader = SdbTable.Select(ServiceId, ServiceSecret, selectExpression)) { WriteItems(reader); } }
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); }