Which code segment should you use?

You create a Microsoft WinForms application that allows you to search within a Microsoft Office SharePoint Server 2007 site collection.

You write the following code segment.

SPSSearchWS.QueryService searchWS = new
SPSSearchWS.QueryService();
string query = “My_Query”;

You need to bind a DataGridView control directly to a query result set.

Which code segment should you use?

You create a Microsoft WinForms application that allows you to search within a Microsoft Office SharePoint Server 2007 site collection.

You write the following code segment.

SPSSearchWS.QueryService searchWS = new
SPSSearchWS.QueryService();
string query = “My_Query”;

You need to bind a DataGridView control directly to a query result set.

Which code segment should you use?

A.
dataGridView1.DataSource = searchWS.QueryEx(query);

B.
dataGridView1.DataSource = searchWS.Query(query);

C.
FullTextSqlQuery sqlQuery = new FullTextSqlQuery(new
SPSite(searchWS.Url));
sqlQuery.ResultTypes = ResultType.RelevantResults;
sqlQuery.QueryText = query;
ResultTableCollection results = sqlQuery.Execute();
dataGridView1.DataSource = results;

D.
kRequest.QueryText = query;
kRequest.ResultTypes |= ResultType.RelevantResults;
ResultTableCollection results = kRequest.Execute();
dataGridView1.DataSource = results;



Leave a Reply 0

Your email address will not be published. Required fields are marked *