query source control
-
Friday, April 20, 2012 2:31 PM
Is it reasonably realistic to query on the version control database or is that like trying to write a query directly against a sharepoint database?
What I am hoping to do is create a single SQL PROC that will show me what is in source control vs what is on our SQL Servers.
Another option, (if I cant reasonably query the version control database) is to write web service queries from within an SSRS report? we used to do that to create reports with Sharepoint information on it.
Thanks for help.
All Replies
-
Saturday, April 21, 2012 2:45 PM
The recommended way to query the version control system is to use the C# client object model in the Microsoft.TeamFoundation.VersionControl.Client namespace. If you have a machine that has TFS 2010 installed on it, then you have this assembly in the GAC. You can create a new C# application and use Add Reference to add it. (Actually you want to add Microsoft.TeamFoundation.Common, Microsoft.TeamFoundation.Client, and Microsoft.TeamFoundation.VersionControl.Common, too.)
Then you can use the VersionControlServer object to ask questions about what is or is not checked into the repository.
TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(new Uri("http://myserver:8080/tfs"));
VersionControlServer sourceControl = tpc.GetService<VersionControlServer>();Now you can use the sourceControl object to call methods like GetItems.
Hope this helps. Thanks,
P. Kelley -
Tuesday, April 24, 2012 5:29 AMModerator
Hi SEAN_MCAD,
How about the issue now?
Kelley has provided information in the reply, if anything is unclear, please free feel to let me know.
Best Regards,
Lily Wu [MSFT]
MSDN Community Support | Feedback to us

