我试图从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; }
所以你应该直接使用你的网格的数据源,设置自动生成列到你的网格开始查看结果