Houston TechFest Wrap-up

As they say, “everything is bigger in Texas” and the Houston TechFest is a great example of that.  A large, independently organized event covering many diverse technical subjects and disciplines.  I really had fun and got to meet some interesting people.

I enjoyed my session, and would like to thank everyone that attended.  My slide deck for the session is available here:

Houston tech fest dev intro to sharepoint searchhttp://static.slidesharecdn.com/swf/ssplayer2.swf?doc=houstontechfest-devintrotosharepointsearch-101128124443-phpapp01&stripped_title=houston-tech-fest-dev-intro-to-sharepoint-search&userName=nextconnect

View more presentations from nextconnect.

Source Code for the Manager Web Part is below:

<code>using System;<br />using System.ComponentModel;<br />using System.Web;<br />using System.Web.UI;<br />using System.Web.UI.WebControls;<br />using System.Web.UI.WebControls.WebParts;<br />using Microsoft.SharePoint;<br />using Microsoft.SharePoint.WebControls;<br />using Microsoft.Office.Server;<br />using Microsoft.Office.Server.Search.Query;<br />using Microsoft.Office.Server.Search.Administration;<br />using Microsoft.Office.Server.UserProfiles;<br />using System.Collections.Specialized;<br />using Microsoft.SharePoint.Administration;<br />using System.Collections;<br />using System.Data;<br />using System.Text;<br /><br />namespace NextConnect.Search.Presentation.DisplayManagers<br />{<br />    [ToolboxItemAttribute(false)]<br />    public class DisplayManagers : WebPart<br />    {<br />        protected Literal literalMessage;<br /><br />        protected override void CreateChildControls()<br />        {<br />            this.literalMessage = new Literal();<br />            this.literalMessage.ID = &quot;literalMessage&quot;;<br />            this.Controls.Add(this.literalMessage);<br />        }<br /><br />        protected override void OnLoad(EventArgs e)<br />        {<br />            base.OnLoad(e);<br />            DisplayFullText();<br />        }<br /><br />        protected void DisplayFullText()<br />        {<br />            StringBuilder messages = new StringBuilder();<br />            DataTable results = new DataTable();<br /><br />            string searchProxyName = &quot;Search Service Application&quot;;<br />            SearchQueryAndSiteSettingsServiceProxy settingsProxy = SPFarm.Local.ServiceProxies.GetValue();<br />            SearchServiceApplicationProxy searchProxy = settingsProxy.ApplicationProxies.GetValue(searchProxyName);<br />            FullTextSqlQuery mQuery = new FullTextSqlQuery(searchProxy);<br /><br />            try<br />            {<br />                mQuery.QueryText = &quot;SELECT LastName, FirstName, JobTitle, accountname FROM SCOPE() WHERE (&quot;scope&quot; = 'People') AND CONTAINS(JobTitle, 'Manager') AND NOT CONTAINS(Department, '1099')&quot;;<br /> <br />                mQuery.ResultTypes = ResultType.RelevantResults;<br />                mQuery.TrimDuplicates = false;<br />                mQuery.RowLimit = 100;<br />                //mQuery.KeywordInclusion = KeywordInclusion.AnyKeyword;<br />                //mQuery.AuthenticationType = QueryAuthenticationType.NtAuthenticatedQuery;<br /><br />                ResultTableCollection resultTables = mQuery.Execute();<br />                if (resultTables.Count &gt; 0)<br />                {<br />                    ResultTable relevantResults = resultTables[ResultType.RelevantResults];<br />                    results.Load(relevantResults, LoadOption.OverwriteChanges);<br />                }<br />                messages.AppendFormat(@&quot;<div>Found {0} result(s).</div><div><ul>&quot;, results.Rows.Count);<br /><br />                foreach (DataRow row in results.Rows)<br />                {<br />                    messages.AppendFormat(@&quot;<li><a href="/my/person.aspx?Accountname={3}">{0}, {1} - {2}</a></li>&quot;, row[0].ToString(), row[1].ToString(), row[2].ToString(), row[3].ToString());<br />                }<br />                messages.AppendFormat(@&quot;</ul></div>&quot;);<br /><br />                this.EnsureChildControls();<br />                this.literalMessage.Text = messages.ToString();<br />            }<br />            catch (Exception ex)<br />            {<br />                this.EnsureChildControls();<br />                this.literalMessage.Text = &quot;Error: &quot; + ex.Message.ToString();<br />            }<br />            finally<br />            {<br />                mQuery.Dispose();<br />            }<br />        }<br />    }<br />}<br /></code>

I hope everyone else enjoyed the event as well!

Tags:

Leave a Comment