You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can use variables in queries to pass user input or calculated values. To create a query that includes variables, create placeholders in the query string using @variable, where "variable" is the name of the variable. Then pass the name (less the "@") and value of each into a dictionary as shown.
// Define a query that uses a variable for the type of work item. stringqueryString="Select [State], [Title] From WorkItems Where [Work Item Type] = @Type";// Set up a dictionary to pass "User Story" as the value of the type variable.Dictionary<string,string>variables=newDictionary<string,string>();variables.Add("Type","User Story");// Create and run the query.Queryquery=newQuery(workItemStore,queryString,variables);WorkItemCollectionresults=query.RunQuery();
The text was updated successfully, but these errors were encountered:
You can use variables in queries to pass user input or calculated values. To create a query that includes variables, create placeholders in the query string using
@variable
, where "variable" is the name of the variable. Then pass the name (less the "@") and value of each into a dictionary as shown.The text was updated successfully, but these errors were encountered: