0

I was trying to retrieve data from Amazon SimpleDB and currently it only displays data in text like domainName: {attribute1, value2} {attribute1, value2}. How can I show the data in data grid view? My code is as follows:

 public static List<String> GetItemByQuery(IAmazonSimpleDB simpleDBClient, string domainName)
    {
        List<String> Results = new List<String>(); ;
        SelectResponse response = simpleDBClient.Select(new SelectRequest()
        {
            SelectExpression = "Select * from " + domainName
        });
        String res = domainName + " has: ";

        foreach (Item item in response.Items)
        {

            res = item.Name + ": ";
            foreach (Amazon.SimpleDB.Model.Attribute attribute in item.Attributes)
            {
                res += "{" + attribute.Name + ", " + attribute.Value + "}, ";
            }
            res = res.Remove(res.Length - 2);
            Results.Add(res);

        }

        return Results;
    }  
user1805430
  • 109
  • 1
  • 8
  • 20

1 Answers1

0

How you an read here:

http://docs.aws.amazon.com/sdkfornet1/latest/apidocs/html/P_Amazon_SimpleDB_Model_SelectResult_Item.htm

your response.Items is

public List<Item> Item { get; set; }

so you should directly use to DataSource of your Grid, set autogenerate column to your grid to start to view the result

ale
  • 10,012
  • 5
  • 40
  • 49