Search code examples
c#amazon-web-servicesamazon-simpledb

amazon simpledb get count


in c#, how do I get the value of count from this response from amazon simpledb (using amazon .net sdk):

<?xml version="1.0" encoding="utf-16"?>
<SelectResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://sdb.amazonaws.com/doc/2009-04-15/">
  <SelectResult>
    <Item>
      <Name>Domain</Name>
      <Attribute>
        <Name>Count</Name>
        <Value>0</Value>
      </Attribute>
    </Item>
  </SelectResult>
  <ResponseMetadata>
    <RequestId>0ef874ad-2298-b6a9-101d-f96a1e188879</RequestId>
    <BoxUsage>0.0000228538</BoxUsage>
  </ResponseMetadata>
</SelectResponse>

i am interested in line:

<Value>0</Value>

for some reason whatever I do I can not get just the value: 0. probably am missing something. can't even share what I tried since I tried many things - even - for each, even though its just 1 result.

this is the query that generated it:

select count(*) from Users where Email = '[email protected]'

so another question:

what does this line in response mean:

<Name>Domain</Name>

I would expect this to be:

<Name>Users</Name>

no?


Solution

  • answer (got it :):

    response.SelectResult.Item[0].Attribute[0].Value