0

I´m trying to execute a simple query:

SELECT * FROM c

To execute this query I have this code

var urlDocument = UriFactory.CreateDocumentCollectionUri(_databaseName, collectionName);
        using (var client = GetDocumentClientAsync())
        {
            var taskQuery = Task.Run(
                () => client.CreateDocumentQuery(urlDocument, query,
                new FeedOptions
                {
                    MaxItemCount = 10,
                    EnableCrossPartitionQuery = false,
                    MaxBufferedItemCount = 100,
                    MaxDegreeOfParallelism = 1
                }).ToList());
            var querydb = taskQuery.Result;

I tried without the auxiliary Task and with other forms (already without the FeedOptions). I always receive this error:

    System.AggregateException was unhandled by user code
  HResult=-2146233088
  Message=Se han producido uno o varios errores.
  Source=mscorlib
  StackTrace:
       en System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
       en System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       en System.Threading.Tasks.Task`1.get_Result()
       en Microsoft.Azure.Documents.Linq.DocumentQuery`1.GetEnumerator()
       en System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       en System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       en DocumentDbApi.DocumentDbRepository.<>c__DisplayClass17_0.<ExecuteQuery>b__0() en D:\Documentos\Visual Studio 2015\Projects\DatabaseStudio\DocumentDbApi\DocumentDbRepository.cs:línea 181
       en System.Threading.Tasks.Task`1.InnerInvoke()
       en System.Threading.Tasks.Task.Execute()
  InnerException: 
       ActivityId=80272f2f-03fc-424f-b6cd-089a5e3e03ef
       HResult=-2146233088
       Message=Message: {"errors":[{"severity":"Error","location":{"start":0,"end":0},"code":"SC1002","message":"Syntax error, unexpected end-of-file."}]}
ActivityId: 80272f2f-03fc-424f-b6cd-089a5e3e03ef, Request URI: /apps/39810a5b-058a-4edb-9502-8ddd6d977eec/services/9170e8c4-983b-45d5-8bdf-5eb5b1400da7/partitions/ed4d1123-d7c5-4d3c-ad13-320875aa8507/replicas/131247462173547477s
       RequestCharge=1
       Source=Microsoft.Azure.Documents.Client

I don´t have problems to do simple read document by id, inserts, updates, replaces, deletes... only with sql queries.

3

1 Answer 1

0

I have installed a Documentdb client dll for other framework version. Now the code runs fine. Thanks

2
  • Just curious, which framework dll you installed earlier that gave you this error? Dec 5, 2016 at 4:40
  • I installed framework 2.0 in a project of windows forms and 4.6.1 in the azure project. Dec 5, 2016 at 15:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.