public void Query(Query query, int[] clist, int[] slist, string options)
        {
            var solList = GetSortList(slist);
            var colList = GetColumnList(clist);

            var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                .SetQuery(query.ToString())
                .SetCList(colList)
                .SetSList(solList)
                .SetOptions(options)
                .SetFmt(true)
                .Build();
            _doQuery(doQuery);
        }
 public void Query(int queryId, string options)
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetQid(queryId)
         .SetFmt(true)
         .SetOptions(options)
         .Build();
     _doQuery(doQuery);
 }
        public void Query(int[] clist)
        {
            var colList = GetColumnList(clist);

            var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                .SetCList(colList)
                .SetFmt(true)
                .Build();
            _doQuery(doQuery);
        }
 public void Query(Query query, string options)
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetQuery(query.ToString())
         .SetCList("a")
         .SetOptions(options)
         .SetFmt(true)
         .Build();
     _doQuery(doQuery);
 }
 private void _doQuery(DoQuery qry)
 {
     Records.Clear();
     try
     {
         XPathNavigator xml = qry.Post().CreateNavigator();
         LoadColumns(xml); //Must be done each time, incase the schema changes due to another user, or from a previous query that has a differing subset of columns
         LoadRecords(xml);
     }
     catch (ViewTooLargeException)
     {
         //split into smaller queries automagically
         List<string> optionsList = new List<string>();
         string query = qry.Query;
         string collist = qry.Collist;
         int maxCount = 0;
         int baseSkip = 0;
         if (!string.IsNullOrEmpty(qry.Options))
         {
             string[] optArry = qry.Options.Split('.');
             foreach (string opt in optArry)
             {
                 if (opt.StartsWith("num-"))
                 {
                     maxCount = int.Parse(opt.Substring(4));
                 }
                 else if (opt.StartsWith("skp-"))
                 {
                     baseSkip = int.Parse(opt.Substring(4));
                 }
                 else
                 {
                     optionsList.Add(opt);
                 }
             }
         }
         if (maxCount == 0)
         {
             DoQueryCount dqryCnt;
             if (string.IsNullOrEmpty(query))
                 dqryCnt = new DoQueryCount.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                     .Build();
             else
                 dqryCnt = new DoQueryCount.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                     .SetQuery(query)
                     .Build();
             var cntXml = dqryCnt.Post().CreateNavigator();
             maxCount = int.Parse(cntXml.SelectSingleNode("/qdbapi/numMatches").Value);
         }
         int stride = maxCount/2;
         int fetched = 0;
         while (fetched < maxCount)
         {
             List<string> optLst = new List<string>();
             optLst.AddRange(optionsList);
             optLst.Add("skp-" + (fetched + baseSkip));
             optLst.Add("num-" + stride);
             string options = string.Join(".",optLst);
             DoQuery dqry;
             if (string.IsNullOrEmpty(query))
                dqry = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                    .SetCList(collist)
                    .SetOptions(options)
                    .SetFmt(true)
                    .Build();
             else
                dqry = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                    .SetQuery(query)
                    .SetCList(collist)
                    .SetOptions(options)
                    .SetFmt(true)
                    .Build();
             try
             {
                 XPathNavigator xml = dqry.Post().CreateNavigator();
                 if (fetched == 0) LoadColumns(xml);
                 LoadRecords(xml);
                 fetched += stride;
             }
             catch (ViewTooLargeException)
             {
                 stride = stride/2;
             }
         }
     }
 }
 public void Query()
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetCList("a")
         .SetFmt(true)
         .Build();
     _doQuery(doQuery);
 }
 public void Query(int queryId, string options)
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetQid(queryId)
         .SetFmt(true)
         .SetOptions(options)
         .Build();
     var xml = doQuery.Post().CreateNavigator();
     LoadColumns(xml);
     LoadRecords(xml);
 }
        public void Query(Query query, int[] clist, int[] slist, string options)
        {
            var solList = GetSortList(slist);
            var colList = GetColumnList(clist);

            var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                .SetQuery(query.ToString())
                .SetCList(colList)
                .SetSList(solList)
                .SetOptions(options)
                .SetFmt(true)
                .Build();
            var xml = doQuery.Post().CreateNavigator();
            LoadColumns(xml);
            LoadRecords(xml);
        }
 public void Query(Query query)
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetQuery(query.ToString())
         .SetCList("a")
         .SetFmt(true)
         .Build();
     var xml = doQuery.Post().CreateNavigator();
     LoadColumns(xml);
     LoadRecords(xml);
 }
        public void Query(int[] clist)
        {
            var colList = GetColumnList(clist);

            var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
                .SetCList(colList)
                .SetFmt(true)
                .Build();
            var xml = doQuery.Post().CreateNavigator();
            LoadColumns(xml);
            LoadRecords(xml);
        }
 public void Query()
 {
     var doQuery = new DoQuery.Builder(Application.Client.Ticket, Application.Token, Application.Client.AccountDomain, TableId)
         .SetCList("a")
         .SetFmt(true)
         .Build();
     var xml = doQuery.Post().CreateNavigator();
     LoadColumns(xml); //Must be done each time, incase the schema changes do to another user
     LoadRecords(xml);
 }