Amazon.SimpleDB.AmazonSimpleDBClient.Select C# (CSharp) Method

Select() public method

The Select operation returns a set of attributes for ItemNames that match the select expression. Select is similar to the standard SQL SELECT statement.

The total size of the response cannot exceed 1 MB in total size. Amazon SimpleDB automatically adjusts the number of items returned per page to enforce this limit. For example, if the client asks to retrieve 2500 items, but each individual item is 10 kB in size, the system returns 100 items and an appropriate NextToken so the client can access the next page of results.

For information on how to construct select expressions, see Using Select to Create Amazon SimpleDB Queries in the Developer Guide.

/// The specified NextToken is not valid. /// /// Too many predicates exist in the query expression. /// /// Too many predicates exist in the query expression. /// /// The value for a parameter is invalid. /// /// The specified query expression syntax is not valid. /// /// The request must contain the specified missing parameter. /// /// The specified domain does not exist. /// /// A timeout occurred when attempting to query the specified domain with specified query /// expression. /// /// Too many attributes requested. ///
public Select ( SelectRequest request ) : SelectResponse
request SelectRequest Container for the necessary parameters to execute the Select service method.
return SelectResponse
        public SelectResponse Select(SelectRequest request)
        {
            var marshaller = new SelectRequestMarshaller();
            var unmarshaller = SelectResponseUnmarshaller.Instance;

            return Invoke<SelectRequest,SelectResponse>(request, marshaller, unmarshaller);
        }

Usage Example

        public Routes GetAllRoutes()
        {
            Routes routes = new Routes();
            using (AmazonSimpleDBClient client = new AmazonSimpleDBClient(_publicKey, _secretKey))
            {
                SelectRequest request =
                   new SelectRequest().WithSelectExpression(
                       string.Format("SELECT * FROM Routes "));
                SelectResponse response = client.Select(request);
                foreach (Item item in response.SelectResult.Item)
                {
                    string value = item.Attribute.GetValueByName("Id");
                    Route route = new Route
                    {

                        Id = Guid.Parse(item.Attribute.GetValueByName("Id")),
                        Distance = item.Attribute.GetDoubleValueByName("Distance"),
                        LastTimeRidden = item.Attribute.GetDateTimeValueByName("LastTimeRidden"),
                        Name = item.Attribute.GetValueByName("Name"),
                        Location = item.Attribute.GetValueByName("Location"),
                    };
                    routes.Add(route);
                }
            }
            return routes;
        }
All Usage Examples Of Amazon.SimpleDB.AmazonSimpleDBClient::Select