我有这个代码将结果输出到文本框
try
{
// Connect to the work item store
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
new Uri("xxx"));
WorkItemStore workItemStore = (WorkItemStore)tpc.GetService(typeof(WorkItemStore));
// Run a query.
WorkItemCollection queryResults = workItemStore.Query(richTextBox1.Text);
foreach (WorkItem workItem in queryResults)
{
richTextBox2.Text = string.Join(Environment.NewLine, workItem.AreaPath, workItem.Project);
}
}
catch (Exception exceptionmessage)
{
MessageBox.Show(exceptionmessage.ToString());
}
}
我可以像处理来自SQL Server的SQL查询一样处理查询结果并将其绑定到数据网格或数据查看器吗?我似乎无法使用它,我不明白如何处理和返回WIQL / TFS数据。
答案 0 :(得分:2)
不,您需要获取查询结果并将它们放入数据集中的表中,然后将数据集绑定到datagrid。有关详细信息,请参阅此文章: http://blogs.msdn.com/b/briancombs/archive/2006/09/19/762210.aspx