将数据从simpleDB放入数据网格视图



我试图从Amazon SimpleDB检索数据,目前它只显示domainName文本中的数据:{attribute1, value2} {attribute1, value2}。如何在数据网格视图中显示数据?我的代码如下:

 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;
    }  

如何阅读此处:

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

你的response.Items

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

所以你应该直接使用你的网格的数据源,设置自动生成列到你的网格开始查看结果

相关内容

  • 没有找到相关文章

最新更新