DataTable queryDataTable = new DataTable();
FullTextSqlQuery myQuery = new FullTextSqlQuery( serverContext);
myQuery.QueryText = "SELECT FirstName,LastName, MobilePhone,JobTitle FROM scope() WHERE \"scope\" = 'People' and (MobilePhone like '%" + key + "%' )";
myQuery.ResultTypes = ResultType.RelevantResults;
myQuery.RowLimit = 10;
ResultTableCollection queryResults = myQuery.Execute();
ResultTable queryResultsTable = queryResults[ResultType. RelevantResults];
int intTotalRecords = queryResultsTable.TotalRows;
queryDataTable.Load( queryResultsTable, LoadOption.OverwriteChanges);
No comments:
Post a Comment