我尝试从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;
}
答案 0 :(得分:0)
你如何阅读:
您的response.Items
是
public List<Item> Item { get; set; }
因此您应该直接使用Grid的DataSource,将autogenerate列设置为您的网格以开始查看结果