Tuesday, December 16, 2008

InfoPath Adding Image to Button ImageButton

This KB article describes, in effect, how to create an ImageButton in InfoPath. 

Monday, December 15, 2008

Sort StringCollection ArrayList

This is the call you need to make to sort a StringCollection.

ArrayList.Adapter(myStringList).Sort();

Friday, December 12, 2008

Internship Available

I stumbled across this internship opportunity at Van Andel Institute for a .NET Developer. It sounds like they want a sophomore student at one of Grand Rapid's colleges or university to work on a bunch of .NET apps. Heavy on SQL Server apparently and some reporting. Maybe they are doing SQL Server Reporting Services in house. Anyway, if you are student and looking for an internship next semester you should apply.

Thursday, December 11, 2008

Coding4Fun Book Code Downloads


http://www.c4fbook.com/default.aspx

All the downloads and source code that you've seen and heard about at TechEd 2008 and PDC 2008 are now available for the coding4fun series and the book. 

http://www.c4fbook.com/media/

I am going to enjoy InnerTube. Get the downloads while you can.

SharePoint Picture Library Item Url


Very nice article and code snippet on how to get the url of the full image and of the thumbnail. 

Monday, December 8, 2008

Programmatically set border width of Excel cell

This MSDN article briefly explains how to do this: http://msdn.microsoft.com/en-us/library/bb209714.aspx

and here is an example that I am using in my code. It just sets the left border weight to thick for the cell located at 1,2. 

range = (Microsoft.Office.Interop.Excel.Range)wsheet.Cells[1, 2];
                                range.Borders[Microsoft.Office.Interop.Excel.XlBordersIndex.xlEdgeLeft].Weight = Microsoft.Office.Interop.Excel.XlBorderWeight.xlThick;

Friday, November 21, 2008

NHibernate Tutorial Videos

I'm just starting to learn NHibernate and needed to get up to speed quickly. The Summer of NHibernate allowed me to do this. Granted the videos are long but the information presented is all crucial and makes it easy to get up to speed on NHibernate.

Thursday, November 13, 2008

Obama Birth Certificate (is faked?)

Here is Obama's Birth Certificate.

http://i305.photobucket.com/albums/nn227/Polarik/BO_Birth_Certificate.jpg

Updated: This is apparently a fake birth certificate, this begs the question as to why the Obama campaign hasn't released the real one. This is all my politics for today. 

Wednesday, November 5, 2008

Custom SSRS Web Parts for SharePoint

No code but sounds like it can be done. This is in regards to developing custom SQL Reporting Services SharePoint Web Parts.

http://blogs.msdn.com/sharepoint/archive/2008/11/03/how-we-did-it-allowing-connections-to-multiple-ssrs-servers-with-report-viewer-and-explorer-web-parts.aspx

Tuesday, November 4, 2008

SPRelinkDocuments released on CodePlex

I have created a project on CodePlex to host this simple Windows application I wrote to assist SharePoint administrators with relinking form templates that are no longer connected to their form templates. The site is http://www.codeplex.com/SPRelinkDocuments

I will manage discussions and issues on CodePlex. I've released the source code and an executable so feel free to take it and run with it. I will add you as a contributor if you'd like to update the code in CodePlex. 

Thursday, October 30, 2008

Grand Rapids SharePoint User Group Meeting Nov 6th

Here is the info:

On November 6, Harold Gravatt of Realign LLC, a MCSE with over 18 years of demonstrated expertise delivering Microsoft based network solutions, will cover implementing the External Collaboration Toolkit for SharePoint using ADAM and FBA. Find out how your company can provide authenticated team site access to clients and partners without adding them to your Active Directory.

 

David Tappan, a MCSE and Senior MOSS Architect at C/D/H, will also lead a ‘How Do I’ presentation on how to configure Kerberos authentication in a multi-server SharePoint farm.


New Horizons

5315 28th St Ct. SE Suite B

Grand Rapids, MI 49546

 

November 6, 2008

6:00pm-8:00pm


Friday, October 24, 2008

SharePoint The EXECUTE permission was denied on the object 'proc_LogChange', database 'SharePoint_AdminContent_, schema dbo

You may receive an error similar to the one below when upgrading or installing a hotfix on SharePoint. I received this and SharePoint didn't tell me anything more than this error message. 

The EXECUTE permission was denied on the object 'proc_LogChange', database SharePoint_AdminContent, schema dbo

To resolve this I logged into the SharePoint web server as the Application Pool account that SharePoint was running under and also granted this user dbo rights on the SharePoint_AdminContent database. I then ran the SharePoint ConfigurationWizard again and the upgrade completed successfully.

Wednesday, October 22, 2008

Gmail Web Slice for Internet Explorer 8

<input type="button" value="Add GMAIL Web Slice" class="addButton"

onclick='window.external.AddToFavoritesBar(

"https://mail.google.com/mail/feed/atom",

"GMAIL", "slice");' />

Creating an IE 8 Web Slice to display your Google Mail Gmail Inbox

This is another very simple example of how to add an authenticated Web Slice that displays the contents of your Gmail inbox in the IE 8 web slice.

Creating a simple Internet Explorer 8 web slice to display RSS Feed

Creating a simple Internet Explorer 8 web slice is pretty easy to do. This example shows how to add a button to your page that will add a web slice to display any valid RSS feed. Again this web slice will display an RSS feed. In this case the web slice displays the RSS feed from this blog.

<input type="button" value="Add Web Slice" class="addButton"

onclick='window.external.AddToFavoritesBar(

"http://feeds.feedburner.com/Officepoint?format=xml",

"OfficePoint RSS Feed", "slice");' />



IE 8 Accelerator Sample Example

This is an example of an IE 8 Accelerator. It doesn't tell you how to create one but it is itself a definition for an accelerator. This is a very simple one that adds an Accelerator that will just redirect the user to OfficePoint when clicked.

<?xml version="1.0" encoding="UTF-8" ?>

    <os:openServiceDescription xmlns:os="http://www.microsoft.com/schemas/openservicedescription/1.0">

        <os:homepageUrl>http://officepoint.blogspot.com</os:homepageUrl>

            <os:display>

                <os:name>Visit OfficePoint</os:name>

                <os:icon>http://blogitems.googlepages.com/office.ico</os:icon>

                <os:description>Visit my site</os:description>

            </os:display>

            <os:activity category="Visit">

                <os:activityAction context="document">

                    <os:execute action="http://officepoint.blogspot.com" method="get" />

                </os:activityAction>

            </os:activity>

    </os:openServiceDescription>


 

In order to add an Accelerator you'll need add a button that adds the service.


 

<html>

<head>

<title>Untitled Page</title>

</head>

<body>

<form id="form1">

<div>

<button id="myButton1" onclick="window.external.AddService('http://localhost/OfficePointAccelerator.xml')">

Add OfficePoint Accelerator

</button>

</div>

</form>

</body>

</html>



Tuesday, October 21, 2008

Generate machineKey web.config

Here is a site that will generate the machineKey for your web.config for you. Useful for the Sitecore AD Module configuration explained below or for any ASP.NET site that needs the machineKey in the web.config.


Unofficial Sitecore 6 Active Directory Module Administrator’s Guide


 

Sitecore has released an Active Directory Module for Sitecore 6 which I believe to be the equivalent of the LDAP Module that was available for version 5.3 and below. This guide will explain how to configure the AD Module in your environment with one AD domain.

  1. Install the AD Module package (you should know how to do this already)

    To verify that it was installed correctly check to see that the following files exist:

  • /bin/LightLDAP.dll
  • /bin/LightLDAPClient.dll
  • /App_Config/Include/ldap.config
  • /sitecore/admin/LDAPLogin.aspx
  • /sitecore/admin/ProviderStatus.aspx


 


 

  1. Open /App_Config/ConnectionStrings.config and add a connection string similar to the one below.

    <add name="LDAPConnection" connectionString="LDAP://{DomainController}/OU={LowestOUName},OU={OUNameAboveLowestOne},DC={DomainName},DC={com or org}"/>

  • DomainController should be the name of one of your company's domain controller server's
  • LowestOUName is the OU you want to get users from
  • OUNameAboveLowestOne is the OU Name above the OU you want to get user's from, you may not have this entry or you may have multiples of this, check out MSDN for LDAP Query specifics.
  • DomainName is the name of your domain
  • Com or org is the .com or .org or .net domain extension


     


     

  1. Open the web.config file and find the <membership provider="sitecore"> tag and add a provider by cutting and pasting from below and filling in your values for the values in brackets.

<add name="{NameOfYourDomain}" type="LightLDAP.SitecoreADMembershipProvider"      connectionStringName="LDAPConnection" applicationName="sitecore"              minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"             requiresQuestionAndAnswer="false" requiresUniqueEmail="false"             connectionUsername="{Sitecore LDAP User}" connectionPassword="{Sitecore LDAP User Password}" connectionProtection="Secure" attributeMapUsername="sAMAccountName" enableSearchMethods="true" />

  • {NameOfYourDomain} is your domain name
  • {Sitecore LDAP User} is the user that Sitecore will use to connect to your AD
  • {Sitecore LDAP User Password} is the password of the above user/>


     


     

  1. Still within the <membership provider="sitecore"> tag, find the provider:


     

    <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="sql" providerWildcard="%" raiseEvents="true" />


     

    and change the realProviderName to switcher so the line now reads


     

    <add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" />


     


     

  2. Now find the <roleManager defaultProvider="sitecore" enabled="true"> tag and add a provider by cutting and pasting from below and filling in your values for the values in brackets.

<add name="{NameOfYourDomain}" type="LightLDAP.SitecoreADRoleProvider" ConnectionStringName="LDAPConnection" applicationName="sitecore" username="{Sitecore LDAP User}" password="{Sitecore LDAP User Password}" />

  • {NameOfYourDomain} is your domain name
  • {Sitecore LDAP User} is the user that Sitecore will use to connect to your AD
  • {Sitecore LDAP User Password} is the password of the above user/>


 


 

  1. Still within the <roleManager defaultProvider="sitecore" enabled="true"> tag, find the provider:


     

    <add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="sql" raiseEvents="true" />


     

    and change the realProviderName to switcher so the line now reads


     

    <add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="switcher" raiseEvents="true" />


     

  2. Add a machineKey to the <system.web> section. It will look like

<machineKey validationKey="" decryptionKey="" validation="SHA1" /> you can go here http://aspnetresources.com/tools/keycreator.aspx to have one created for you, just generate one using the default values on that page. Example:

<machineKey validationKey="F0893ED36F497B12D0374825033C51F92E85A028C05E65474FB39D41240A6F11F06B531FFC07C3A53239CE8B789C624A7486556E44D8F7165A249605E86375E7"

decryptionKey="7509A38E7B68F1A610D6463B977805F2008D9EDAF2C55E79" validation="SHA1" />


 

  1. Find a section in the web.config similar to <switchingProviders> and add the sections in bold.

<membership>

<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />

     <provider providerName="{NameOfYourDomain}" storeFullNames="false" wildcard="*" domains="{NameOfYourDomain}" />

</membership>

<roleManager>

<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />

     <provider providerName="{NameOfYourDomain}" storeFullNames="false" wildcard="*" domains="{NameOfYourDomain}" />

</roleManager>

<profile>

<provider providerName="sql" storeFullNames="true" wildcard="%" domains="*" />

</profile>

</switchingProviders>


 

  1. Open up /App_Config/Security/Domains.config.xml and add a domain.

<domain name="{NameOfYourDomain}" ensureAnonymousUser="false" />


 

If you've done everything correctly you should now be able to open up User Manager in Sitecore and see users from your AD OU listed.

Improving Sitecore 6 Active Directory Module Performance

There is a new module for Sitecore 6 called Active Directory Module which seems to replace the LDAP Module that was available in Sitecore v5.3 and below. This new module uses the ASP.NET Membership provider available with ASP.NET 2.0. The Official Administrator's guide to this new module explains how to configure it for your Sitecore environment. I will release my unofficial guide in the next day or so but in the meantime you should be aware there are significant performance issues with it that were not present in the old LDAP Module. At least for me and one other person there has been. These steps will explain how to work around these performance issues but aren't supported by Sitecore so be sure to backup all the files I tell you to edit. I haven't seen any problems with this workaround but if you do let me know and I'll investigate, as far as I know these changes do not cause any additional issues. So let's get to it.

When trying to use the User Manager and page through the many users from your AD domain you may notice that it is too slow to use. To improve this you'll want to do a few things:

    Open up the web.config file and find the following line which defines the number of rows returned when paging through the grid which is a Component Art Web UI Grid.

<setting name="GridPageSize" value="15" />

Change the value to 24.

Now open up C:\Inetpub\wwwroot\{websitename}\WebSite\sitecore\shell\Applications\Security\UserManager\UserManager.aspx

Change the PageSize="20" property of the grid to PageSize="24"

Within the columns definitions of the grid comment out the columns for the Domain, Profile.Email, Profile.Comment, Profile.ClientLanguage and Profile.State. This is the change that really improves the performance. You probably don't care about all those fields anyway, and if you do, then just uncomment the one you want to see and it will appear in the grid.

As a side note, the Grid has a property called RunningMode which is set to CallBack, if you set it to Server instead it will cause the Grid to do a post back when paging which I have found did not significantly increase the performance of the paging but if commenting out the lines above doesn't help you may want to try that.

Also within your LDAP query in the AD Module try to get it down to one OU or a few OU's with few people in them, the more data it needs to bring back the worse performance will probably be.

With the changes above, open the User Manager and now instead taking a few minutes to get to the next page or not paging at all, it should only take < 1 min to page to the next set of users. Not great but better than what it was before we started.

The other pain point is managing roles with the Role Manager and managing user roles inside the Role Manager. Comment out the same lines as above in the following files and your performance using Role Manager should also increase.

All files in C:\Inetpub\wwwroot\{websitename}\WebSite\sitecore\shell\Applications\Security\RoleManager include similar Grids except for NewRole.xaml.xml.

And C:\Inetpub\wwwroot\SitecoreSix\WebSite\sitecore\shell\Applications\Security\SelectAccount\SelectAccount.xaml.xml contains a similar grid that you can comment out the Email and Profile.Comment columns.

Friday, October 17, 2008

West Michigan SharePoint User Group Meeting November

We invite you to attend the West  Michigan SharePoint User’s Group Meeting on Thursday, November 6, 2008-seating is limited so please Register Today!

 

On November 6, Harold Gravatt, a MCSE with over 18 years of demonstrated expertise delivering Microsoft based network solutions, will cover implementing the External Collaboration Toolkit for SharePoint using ADAM and FBA.

 

David Tappan, a MCSE and Senior MOSS Architect at C/D/H, will also lead a ‘How Do I’ presentation on how to configure Kerberos authentication in a multi-server SharePoint farm.

  New Horizons

5315 28th St Ct. SE Suite B

Grand Rapids, MI 49546

 

November 6, 2008

6:00pm-8:00pm

Please join us and share your ideas and best practices while networking with your peers.  Food and drink will be served.

Tuesday, October 14, 2008

Unofficial Sitecore Migration Guide Upgrading from Sitecore 5.3 rev 071114 to Sitecore 6

I've posted the guide as a post but the images didn't show up, so here is the downloadable copy of the guide. Just follow it exactly and you should be able to get your Sitecore 6 site running and upgraded from Sitecore 5.3. The upgrade of Sitecore 5.3 was relatively easy and I like how the Sitecore 6 update packages include all previous updates, it makes it a lot easier to get to the current version.

Upgrading from Sitecore 5.3 rev 071114 to Sitecore 6

Unofficial Sitecore Migration Guide Upgrading from Sitecore 5.3 rev 071114 to Sitecore 6

Unofficial Sitecore Migration Guide

Upgrading from Sitecore 5.3 rev 071114 to Sitecore 6


 

Step One: Install Sitecore 6

    Screen shots of installation below.


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

Must be SQL 2005 or 2005 Express Database


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 


 

Attempt to launch http://sitecore6/sitecore if you receive the error below then do the following: remove and then add the sitecore sql user to the Sitecore 6 databases as dbowner.

Databases:

    {web site name}Sitecore_Core

    {web site name}Sitecore_Master

    {web site name}Sitecore_Web


 


 


 


 

Switch to the Advanced view, select Desktop, click the Hide Warning button. The username is Admin and the password is b.


 


 

Attempt to launch http://sitecore6, if you've done everything right you will see the screen below.


 


 

Ok if you've made it this far you now have a clean installation of Sitecore v6.


 


 

Step Two: Grant Access


 

    Grant "Network Service" and "Internet Guest Account" Full Control rights to the Sitecore 6 web root within C:\inetpub\wwwroot if that's where you choose to install Sitecore 6.


 

Step Three: Make a backup copy of the original Sitecore 6 root folder

    

    Just in case you need to revert back to an original file, make a copy of the Sitecore 6 web site root folder.


 

Step Four: Install updates to Sitecore 6


 

    Download Sitecore 6.0.0 Update rev. 080912.zip which fixes Sitecore's problem with .NET 3.0 SP1. (Or download the lastest update which contains the fixes for all previous updates)


 

Install the update package and overwrite all when prompted.


 

To verify that is was install successfully check the version of Sitecore.Client.dll in the bin directory of the web site. It should say 6.0.0 rev. 080912 if it doesn't then the update wasn't installed.


 


 

Step Five: Install upgrade prerequisite packages


 

    Download the Database Conversion tool and extract the contents which should give you two zip files: Sitecore Update Installation Wizard-2.0.0 rev. 080730.zip and V6DBConversionTool-1.0.0rev080923.zip


 

    Install Sitecore Update Installation Wizard-2.0.0 rev. 080730.zip first and overwrite all when prompted. To verify that this update was successful verify that a Sitecore.Update.dll file exists in the bin directory of the web site.


 


 

    Now install V6DBConversionTool-1.0.0rev080923.zip and overwrite all when prompted. To verify that this update was successful look in the sitecore/admin/ folder within the website root there should be a folder called upgrade with three folders in it and then additional files within those folders.


 

Step Six: Copy security template files


 

    Copy the "security templates.xml" in the old Sitecore installation from /sitecore/shell and copy it to the new Sitecore 6 installation into /sitecore/shell.


 

Step Seven: Modify connectionstrings.config file


 

    Open up App_Config/ConnectionStrings.config and rename the master connection string to v6_master. Then add connection strings to the Sitecore 5.3 databases except for the web database. Oh and the core database string for the 5.3 connections should be named v53_core. Example of a fully modified file is below.


 

<add
name="core"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore\SQLEXPRESS;Database=SitecoreSixSitecore_Core" />

    <add
name="v6_master"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore\SQLEXPRESS;Database=SitecoreSixSitecore_Master" />

    <add
name="web"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore\SQLEXPRESS;Database=SitecoreSixSitecore_Web" />

    <add
name="master"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114Master" />

    <add
name="security"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114Security" />

    <add
name="extranet"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114Extranet" />

    <add
name="v53_core"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114Core" />

    <add
name="recyclebin"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114RecycleBin" />

    <add
name="archive"
connectionString="user id=sitecore;password=***;Data Source=bc-sitecore;Database=sc531071114Archive" />


 


 

Step Eight: Copy some include files


 

    Copy the .include files in /sitecore/admin/upgrade/IncludeFiles to /App_Config/Include and rename the name.config.disabled files to name.config. Each include with the .config extension will be upgraded those with the .disabled extension will not be upgraded. So only rename those databases that you want to upgrade. To verify that Sitecore picked up all the databases, log into Sitecore and click on the database button in the lower right hand corner of the console, you should see all of them you add appear.


 

Step Nine: Pray that the conversion wizard works


 

    First you'll need to go into IIS and grant anonymous access rights to the /sitecore/admin folder/


 


 


 

Then browse to http://{sitecoreurl}/sitecore/admin/upgrade/main.aspx. Go through the wizard and choose to automatically do the conversion process. And eventually you'll hit the "Start Conversion" button. If you were successful, depending on the size of your databases (my core and master were around 4GB), 1 hour later you will see:


 


 


 

If you were unsuccessful you may see the error below. This was a fairly easy fix for me. I was trying to convert a SQL 2000 database but since sys.objects doesn't exist in SQL 2000 I had to upgrade them to SQL 2005 and then run the conversion again. After doing that it was successful.


 

2652 14:15:52 ERROR Failed to upgrade the database

Exception: System.Data.SqlClient.SqlException

Message: Invalid object name 'sys.objects'.

Source: .Net SqlClient Data Provider

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

at System.Data.SqlClient.SqlDataReader.get_MetaData()

at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

at System.Data.SqlClient.SqlCommand.ExecuteScalar()

at Sitecore.V6DBConversion.SqlServerDatabaseConverter.ExecuteScalar(String cs, String sql)

at Sitecore.V6DBConversion.SqlServerDatabaseConverter.Convert(SqlServerDataProvider provider, IOutput output)


 


 

Great, you've made it this far, now only a few more hours of waiting.


 

Step Ten: Rebuild some Sitecore databases


 

    First let's clean up the databases by rebuilding the link database for the Core and Master databases. Then rebuild the search indexes on the Core and Quick Search options.


 

Step Eleven: Republish entire site


 

    Go to the Home section and then the Publish option and Publish site. This is where you wait for a few hours while Sitecore copies data out of the master database to the new Web database. Don't screw with anything else just let it run and depending on the size a few hours later it will say successful. If not, start it again and do an incremental publish so you don't have to republish everything.


 

Step Twelve: Remove some old upgrade files


 

    Remove and I do mean remove all the .config files within the /App_Config/Include folder. If you just copy them to another folder within that folder you'll get errors, so just get rid of them completely.


 

    In the /App_Config/ConnectionString.config file get rid of all entries except the Core, Web and Master strings.


 

    Delete the /sitecore/admin/upgrade folder

    

    If a /sitecore/admin/packages/tool folder exists, delete that too, I didn't have one so I didn't need to delete it.


 

    Delete the following files if you have them


 

  • /sitecore/admin/upgrade.aspx, mine was named update.aspx
  • /sitecore/admin/web.config
  • /bin/sitecore.diffinstaller.dll, I didn't have this file
  • /bin/DiffLib.dll, I didn't have this one either
  • /bin/Sitecore.Upgrade.dll, mine was named Sitecore.Update.dll
  • /bin/Sitecore.V6DBConversion.dll


 

    Take offline and a few weeks later get rid of the security, extranet, archive and recyclebin and possibly the v6 master database from SQL.


 

Step Thirteen: Restore the clean web.config


 

    You should have a copy of the clean v6 web.config file, copy that file to the new v6 web site root and replace the one that's already in there.


 

Step Fourteen: Copy custom files to the new v6 root


 

    Copy your custom files from the v5.3 root to the v6 root

    

  • Layouts
  • Images
  • Xsl
  • Media
  • Css
  • Any other folders that are in your site that don't exist in the v6 site that are needed

    

Compile your solution against the new Sitecore dlls and copy the dll to the bin folder of the v6 site


 

Merge any web.config customizations from the v5.3 config file to the v6 config file, possibly app settings or ajax stuff.


 

Step Fifteen: Test, Test and Test


 

    Test the site.

Friday, October 10, 2008

SharePoint Date Picker Control

This explains how to use the date picker control that SharePoint provides. This example uses it in a web part.

RenderContents...

DateTimeControl dtcBegin;
DateTimeControl dtcEnd;
dtcBegin = new DateTimeControl();
dtcEnd = new DateTimeControl();
this.Controls.Add(dtcBegin);
this.Controls.Add(dtcEnd);

And to reference the selected date do this:

System.DateTime start = dtcBegin.SelectedDate;
System.DateTime end = dtcEnd.SelectedDate;

Thursday, October 9, 2008

Wednesday, October 8, 2008

FBHW Free Beer and Hot Wings Podcast Url Information removed and added

I'm removing the direct links to their podcast from this blog. I will no longer post their url.

With that said, the podcast is still freely available on mediafly, signup and search for "the freebeer and hotwings morning show" on their site. It's now mediafly's problem.

Friday, October 3, 2008

Current configuration settings prohibit embedding username and password in the database connection string SharePoint InfoPath

You may get this error using an InfoPath form within SharePoint

Current configuration settings prohibit embedding username and password in the database connection string.)

SharePoint Central Admin -> Application Management -> Configure InfoPath Forms Services.

Check the box next to Allow embedded SQL authentication and click the OK button.

Thursday, October 2, 2008

Grand Rapids Tech Lunch #5

Date -- October 6th, 2008

Time -- 12:00 to 1:30 PM

Place -- Grand Rapids Brewing Co. @ NE corner of 28th Street and East Beltline by Centerpointe Mall

Great bunch of guys and gals getting together to discuss technical stuff once a month. Check out http://grtechlunch.com/grafitti/meetings/5-grtechlunch-event-october-6th-2008-grand-rapids-brewing-company/ for more information.

Two InfoPath Contact Selector Controls On One Form

This information comes from the comments section of the InfoPath Team Blog.

Say you want to add two InfoPath Contact Selector controls to one InfoPath form. This sounds simple enough, create your group and then add the Person repeating node with the DisplayName, AccountName and AccountId fields like you normally would to the Person group. Trying to duplicate this same group again for the second contact selector control will throw an error because you can't have fields or groups with the same names. But knowing that the names have to be exact to have the contact selector control work, the question arises how do we duplicate the data source for the InfoPath contact selector control.

Well assuming you have a group named grpPersonSelector bound to the first InfoPath contact selector control. Create another group named really anything we'll use grpPersonSelectorTwo. Now right click on the Person repeating group under grpPersonSelector and click Reference and choose grpPersonSelectorTwo.

That's it, now the grpPersonSelectorTwo group can be bound to your second InfoPath contact selector control. Thanks Scott for this information.

Monday, September 29, 2008

WSS MOSS SharePoint version numbers

This is a very nice article describing how to find out which version of SharePoint you are running.

http://www.mindsharpblogs.com/penny/articles/481.aspx

Another great post regarding SharePoint versions from MindSharp.

Friday, September 26, 2008

Excel 2007 Add-in: Synchronizing Tables with SharePoint Lists

This is a nice add-in to Excel that lets it do a two way sync with a SharePoint list.

http://www.microsoft.com/downloads/details.aspx?FamilyID=25836e52-1892-4e17-ac08-5df13cfc5295&DisplayLang=en

And this explains how to use it. Publishing and Synchronizing Excel 2007 Tables to SharePoint Lists

http://msdn.microsoft.com/en-us/library/bb462636(office.11).aspx

Wednesday, September 17, 2008

Outlook BCM running on SQL Server 2008

Will BCM 2007 using a shared database work on SQL Server 2008? The answer is not clear. Technically there is no reason why it shouldn't. However, it has not been tested with SQL 2008 and the increased security in SQL 2008 may cause issues.

Should you move to SQL 2008 if you are using a BCM 2007 shared database? Probably not.

Can you? Yes, but you're pretty much on your own to troubleshoot any issues that arise to make it work correctly.

If you have done this, shoot me a note and let me know the steps you took or issues you ran into, I'm sure others would love to get feedback on how it went.

Improve Outlook BCM Business Contact Manager Performance - Three Outlook BCM Performance Tips

Many complaints about BCM is that it is a performance hog, it's slow, unresponsive, it freezes Outlook... blah blah blah. Well let's try to improve it a bit shall we.

First, if you aren't using the email linking feature then shut it off. I believe it's off by default but if you still go into Business Contact Manager -> Manage E-Mail Auto Linking, there are two tabs one for Emails and one for Folders. Click the "Clear All" button on both tabs and click ok.

Second, if you are in a shared database environment, each machine with BCM installed is hitting your SQL server every second. This creates a lot of traffice and a lot of performance problems. You most likely don't need to get your BCM data updated every second. This update is called a Polling Interval. This Polling Interval was supposedly set higher if you installed the service pack for BCM, however this probably isn't the case. So you need to manually set it higher. To do this open up Registry Editor on each client machine. The path to the key is HKCU -> Software -> Microsoft -> Business Solutions eCRM. Create a DWORD key in that folder called PollingInterval. Modify it's value and set the Decimal value to 180000 which is 180000ms or 3 minutes. Each minute is 60000ms so the Decimal value for one minute would be 60000. This way the client machine will only hit the SQL server every 3 minutes way down from every second.

Third, set the SQL memory for the client machines. By default each client machine will have SQL Server 2005 Express installed on it, this installs with Outlook BCM. By default the maximum amount of memory that SQL Server 2005 Express can use is 2147483647MB, that's huge and unnecessary for BCM. Download and install the SQL Management tools (http://www.microsoft.com/downloads/details.aspx?FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en) on each client machine. Connect to the local SQL Express server and right click on the server within the management studio and choose Properties. Within the pane that comes up, click the Memory link and set the Max Amount of memory to 256MB. That's plenty for BCM. Click OK and it's done.

These 3 performance tips will help with the BCM performance.

Send me a comment if you need additional help.

Tuesday, September 9, 2008

Record iTunes streaming radio music

Download UrlHelper and follow the instructions on the page below. It actually works.

http://www.streamingstar.com/How-to-record-iTunes-radio.htm

Don't know how legal it is since ripping music seems to be off limits nowadays but what the hell, go for it.

Monday, September 8, 2008

Convert ArrayList to string[] array

So simple, yet I didn't know it.

VB: stringArray as string[] = arrayList.ToArray(typeof(string)) as string[];

C#: string[] stringArray = (string[])arrayList.ToArray(typeof(string));

Friday, September 5, 2008

form template cannot be opened in Microsoft Office InfoPath because it contains code that requires a version of the Microsoft Common language runtime

I received this error while trying to open an InfoPath form.

the form template cannot be opened in Microsoft Office InfoPath because it contains code that requires a version of the Microsoft Common language runtime that is not currently installed

I searched Google and MSDN but no solutions or even mention of this problem. After watching some tv last night and installing XP SP3 on my home computer it came to me that the CLR library needs to somehow get updated or fixed. But Windows had already been repaired and Office 2007 reinstalled, that should have fixed it but nope.

Hmmm.... I got it, let's try to install .NET Framework 3.5 SP1 and see what happens. There have been improvements made to the CLR in 3.5 SP1 and should maybe update the missing dlls. Sure enough after installing 3.5 SP1 and trying to open the form again it opened without problems.

So installing the latest version of the .NET framework fixed the issue.

Thursday, September 4, 2008

Create a digital collage

This very cool tool from Microsoft Research creates a digital collage for you.

http://research.microsoft.com/AutoCollage/

Thursday, August 28, 2008

IE 8 Download

The Internet Explorer 8 beta 2 is now available download IE 8 from http://www.microsoft.com/windows/internet-explorer/beta/default.aspx

Wednesday, August 27, 2008

OneNote Web Exporter - Display OneNote on SharePoint

This free add-on to OneNote gives the user the ability to export a web page view of a OneNote document. You can even export it to SharePoint and use a page view web part to host the webview.html page within a SharePoint site.

http://www.codeplex.com/ONWebber

This add-on sure beats my Word2OneNote.

Even better idea, create a Shared Notebook that is stored on SharePoint, export this Notebook to the same SharePoint library. Now multiple users can open and edit the Notebook and export it back to update the web page.

Hmmm.... wonder how concurrent updates are dealt with?

Sitecore 5.3 Archive Item

Here is the documentation on how to archive a Sitecore 5.3 Item.

http://sdn5.sitecore.net/SDN5/End%20User/Site%20Administration/Item%20Management/Archiving%20Items.aspx

Sitecore Restore Archive Item

Once again Sitecore lets me down as there is no way to easily restore an archived item from the Archive database within Sitecore 5.3. Note that there is no Archive database in Sitecore 6. But for those of us that are still on Sitecore 5.3 until they release some sort of migration tool we still have the Archive database.

Anyway, this guy has a nice post on how to add the missing Restore option for Archived items. http://usoniandream.blogspot.com/2007/07/tutorial-restore-from-archive.html

One thing to note about Archiving items, just because you archive them doesn't mean they still aren't published. To truly archive an item, you should first make it as not publishable, then publish it (this will ensure the page is removed from the web database, then Archive the page, then save it. If you refresh the parent node of that page you'll notice that the page is now gone and now exists within the Archive database.

Friday, August 22, 2008

Job Justifications, Systems you manage... my experience is not good

At my previous employer my manager came to me one day asking me to detail what I work on i.e. what systems do I manage and to provide a weekly percentage of this work in an Excel spreadsheet. I thought ok, he just wants to know what I do everyday. Not quite, 2 months later the company announces they are being acquired by another. People get cut, my manager did, somehow I remained.

What I learned: When a manager asks for this type of information it might indicate the company is about to be acquired.

Current Day: My manager asks all of us to provide information about the systems we support and what we work on weekly. This scares me a little as it sounds a lot like my previous employer.

My list is going to be 10 pages long this time.

Anyway, for those of you out there that encounter this type of situation, either come up with a huge list or pack your bags. In my case, I was young and had a lot of potential, I think that's why I was kept, plus I was making dirt for pay.

SQL 2008 Open Table is gone

Another change that wasn't obvious at first is that the Open Table option is gone when a table is right clicked. I'm sure that was probably ambiguous so MS had to take it out.

The Open Table command has now been replaced with Edit Top 200 Rows.

Well what if there is a row at 201 that I want to edit. Is there no easy way to right click and just open all the rows.

SQL 2008 Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created.

I've just started using SQL 2008 and have encountered a very annoying problem. Whenever I change a table I get an error:

Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created.

WTF? I was able to change tables whenever I wanted to in SQL 2000 and 2005 and now I'm not allowed to in SQL 2008. Oh wait, I need to disable some stupid option that shouldn't have been enabled in the first place. To do this follow these instructions:

Within SQL Management Studio click on the Tools menu. Then Options, then the Designer node and uncheck the box that says: Prevent saving changes that require the table to be re-created.

Now we can actually work with tables like we were able to do in SQL 2005. Nice extra step MS, next time make it more difficult to do what we need to do.

Wednesday, August 20, 2008

Vista SP1 Prompts When Opening Documents From SharePoint

You are prompted to enter your credentials when opening a document stored in SharePoint when using Vista. SharePoint and Vista don't play well together by default unless you install Vista SP1 and then hack that registry.


http://support.microsoft.com/?id=943280


Oh and don't forget to restart the WebClient service as well as IE after you hack that registry. SharePoint documents will prompt for credentials when running Vista if you don't configure Vista correctly.

Monday, August 18, 2008

TechEd 2008 DVD Set Arrives

Today I received the completed DVD set of the sessions, keynotes and presentations given at this year's (2008) TechEd down in Orlando, FL.

Again I'll have to reiterate that I wasn't blown away by TechEd. It seemed a little elementary and I was expecting more deep dives into the technologies. Maybe that's what the PDC is for. Either way, I won't be going to next years in L.A., maybe the year after when it's in New Orleans.

Missing WebTrends Hit and Visit Filters after 8.5 upgrade

After upgrading to WebTrends 8.5 I noticed that all my hit and visit filters disappeared. I didn't bother to write down all the configuration of these filters before the upgrade because really who would. I called support and they were easily able to get my filters back with a minimal amount of work.

First stop a couple of WebTrends services. First stop the User Interface and then the Scheduler Agent.

Next browse to your WebTrends directory most likely C:\Program Files\WebTrends\storage\config\wtm_wtx\datfiles\filters. You should see a bunch of .bak files. Take the most recent .bak file it may be named something similar to hits_webtrendsdatetime.bak. Make a backup copy of hits.ini and call it hits.ini.old. Now take the hits_webtrendsdatetime.bak file and rename it to hits.ini.

Now start up the WebTrends service in the opposite order, so start the Scheduler Agent and then the User Interface. Log into the WebTrends console and you should now see your hit filters back. This same process will work for visit filters as well just use the visits.ini file and the visits_webtrendsdatetime.bak files instead.

Also notice that when you stop the WebTrends User Interface service that the WebTrends Tomcat service stops as well, and when you start the User Interface service the Tomcat service will start.

Hope this helps someone.

Wednesday, August 13, 2008

Sitecore and .NET Framework 3.5 SP1 Service Pack 1

Do not install .NET 3.5 SP1 on your Sitecore server, doing so may result in long hours and a broken site. Here is the information directly from Sitecore that I recently received in an email.


Dear Sitecore Enthusiast,

You are receiving this message because you are subscribed to the Sitecore Product Issues and Patches mailing list.

On Monday, August 4th, Microsoft released the following service packs: Visual Studio 2008 SP1 and .NET 3.5 SP1.

Sitecore has discovered that these service packs introduce a bug in the LosFormatter class (System.Web.UI.LosFormatter in System.Web.dll, used to serialize and deserialize an ASP.NET ViewState). This bug causes stability issues in Sitecore products. Sitecore has raised this as an urgent priority issue with Microsoft (case number : SRQ080813600454) and is working to help resolve this issue.

In the meantime, PLEASE DO NOT INSTALL .NET 3.5 SP1 and Visual Studio 2008 SP1 on any server running a Sitecore product (including Sitecore WCMS, Intranet Portal, and Foundry) until further notice!

Symptoms associated with installing either of these service packs:
  • Memory consumption increases dramatically and single core CPU usage goes up to 100% when opening the Access Viewer or Media Library applications.
  • OutOfMemoryExceptions thrown in the Desktop and Content Editor.
  • The browser becomes unresponsive when accessing Sitecore.

Please be aware that Microsoft may include this Service Pack as part of the monthly ‘Patch Tuesday’. Please take steps to avoid the automatic installation of these service packs.

Please be aware that the final version of SQL Server 2008 will require .NET 3.5 SP1.
If you have any questions about this issue, please contact Sitecore support.

Best Regards, Sitecore Support Team.

Tuesday, August 12, 2008

Blogger favicon.ico

Wondering how I got the cool favicon by the url within your web browser. I followed the instructions found http://tips-for-new-bloggers.blogspot.com/2007/02/adding-favicon-icon-to-blogger-url.html to add it.



I think Blogger should make it easier to put a favicon within the url but since they don't you can just follow the instructions in the link above to add the favicon to Blogger.

SharePoint Limited Access permissions

What exactly does Limited Access mean when you see it applied to an individual or a group within SharePoint? What access do they have and why do they have it? It's not obvious to tell within the SharePoint user interface what Limited Access means. Now we have a tool to tell us what SharePoint Limited Access really means. Check out http://www.codeplex.com/SPLimitedAccessDisco

It has 47 downloads since it's release in late July 2008. I think if more people knew about this Limited Access tool that there would be more. Hopefully people will see this post and download it.

Monday, August 11, 2008

Visual Studio 2008 SP1 Download

Here is the download link. It installs Visual Studio 2008 SP1 (Service Pack 1) and .NET Framework 3.1 SP1.

http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en

Friday, August 8, 2008

DateTime.ToString Formats

I always use the following reference page to find a DateTime ToString format. It's a very good reference page for Date Time String Formats. I suggest you bookmark it yourself.

http://authors.aspalliance.com/aspxtreme/sys/demos/datetimeformats.aspx

Creating a custom Visual Studio Theme

Forget trying to create a Visual Studio theme by yourself, by using the frickin sweet tool below, you can create a Visual Studio theme within seconds and import it into Visual Studio and start using it.

http://frickinsweet.com/tools/Theme.mvc.aspx

Visual Studio themes are frickin sweet man!!

Thursday, August 7, 2008

Adding a SharePoint Site Picker to a SharePoint layouts page

Very nice article detailing how to add a SharePoint site picker to a custom page within the layouts directory.

http://chrissyblanco.blogspot.com/2008/07/adding-sharepoint-site-picker-to_03.html

Upgrading WebTrends from 8.1 to 8.5

The upgrade from WebTrends version 8.1 to 8.5 did not go smoothly. The big difference between the 8.1 versions and 8.5 is that instead of using mysql databases 8.5 now uses SQL databases specifically running on SQL Server 2005 Express Edition. During the upgrade 8.5 installed SQL 2005 Express and converted the mysql databases to SQL databases. This all seemed to go fine except when the WebTrends site came up it still pointed to the old mysql databases even though the SQL databases were created and converted successfully.

Support had me first uninstall 8.5 and then reinstall 8.5, after this we tried restoring the converted databases over the empty 8.5 databases. This did not succeed as when the site was browsed a SQL error was displayed. So support had me uninstall 8.5 and reinstall 8.1 specifically 8.1.0.5164. After we had a blank 8.1 installation running I stopped the WebTrends services and made copies of the storage, wt_sched and wtmaster folders that exist within the WebTrends folder within Program Files. I then copied in my backup folders of these (I made backups of these before doing any upgrade, apparently all the data is stored in these folders). I then restarted the WebTrends services and browsed to the WebTrends site. Success, the site came up, I was able to login and all my analysis data was there.

After we verified some of the data in the 8.1 version, we upgraded to 8.1a which I believe is 8.1.0.2048. After the upgrade we again logged into the WebTrends site and verified the data. Just a note here, one of the many technicians I spoke to told me that the upgrade would only be successful from 8.1a to 8.5. This explains why my 8.1 to 8.5 upgrade didn’t go well. The data was correct so we then upgraded to 8.5, we logged into the WebTrends site again and finally the data was all there.

You can verify version and database platform by logging into the WebTrends site, going into the Administration area and then into Install Components. On that page is a link to About WebTrends which displays the version number and database platform.

Lessons learned: Upgrade to 8.1a before attempting to upgrade to 8.5.

Tuesday, August 5, 2008

Grand Rapids has been Google Street View

Check out Google Street View of Grand Rapids, MI.

http://maps.google.com/help/maps/streetview/

I didn't see the car go by but it must have been pretty recent because it has the construction in downtown filmed.

Monday, August 4, 2008

West Michigan SharePoint User Group September 2 Meeting

New Horizons
5315 28th St Ct. SE Suite B
Grand Rapids, MI 49546

September 2, 2008
6:00pm-8:00pm

On September 2nd, David Tappan of C/D/H and Clay Osborn of Blue Sphere Solutions will do a deep dive on using data view/data form web parts to surface and present content from multiple sources. They will show how the data view web part is the “swiss army knife” of web parts. The presentation will include tips and tricks on setting up data connections and little known settings in SharePoint Designer, as well as how to do some amazing customizations of both functionality and look and feel using XSLT.

John von Rosen, a Software Consultant for Blue Sphere Solutions, will be giving a presentation on using the Business Data Catalog in SharePoint to provide insight into corporate data in an enterprise dashboard.

The presentation will provide information for business users by demonstrating the potential for access to business data in a dashboard. We will also cover the technical aspects, such as understanding the BDC metadata definition file.
Please join us and share your ideas and best practices while networking with your peers. Food and drink will be served.

Friday, August 1, 2008

IE 8 Beta Program

Speaking of beta programs, I have been invited to participate in the Windows Internet Explorer 8 beta tester program.

I look forward to getting prereleases of the software and providing direct feedback to MS about any bugs I find.

If you would like to apply see this post View article...

Office 14 Estimated Release Date

Office 14 appears to be scheduled to be released in Q4 of 2009 or Q1 of 2010. Given that timeline the Office 14 beta program will probaby not start until late this year or early next year. I remember participating in the Office 2007 beta program and I believe that started the same year that that Office system was released.

I also saw a rumor that Windows 7 could be released around that same timeframe, wonder if MS will do another Office - Windows launch.

"This document outlines the future direction of Microsoft Dynamics CRM through to the next major release, Microsoft Dynamics CRM “V.Next”, which will be aligned with the Office 14 wave of product releases due in late 2009/early 2010." from http://blogs.msdn.com/dynamicscrmonline/archive/2008/07/23/microsoft-dynamics-crm-statement-of-direction.aspx

Of course non of this is confirmed except for the information provided in the post by MS above about the estimated Office 14 release date.

Thursday, July 31, 2008

SharePoint Mobile Enabled Lists Document Libraries

I was under the impression that by default all lists and libraries within SharePoint were mobile enabled by default. However this is not the case.

To mobile enable a list, Modify the view you would like to make mobile, scross down to the Mobile section and check the box.

Tuesday, July 29, 2008

Convert InfoPath form to PDF Document

I wanted to know how to do this for a long time now but never really spent the time to figure it out. And sometimes that's a good thing because people do it for you. As in this sample about how to convert the InfoPath form to a PDF.

http://aspalliance.com/1466_Printing_InfoPath_2007_WebBased_Forms_to_PDF.6

The solution uses an open source project for the PDF generation called iTextSharp. I haven't tried it yet but I also don't know of a lot of free pdf libraries.

Monday, July 28, 2008

Programmatically remove InfoPath digital signature

This code will need to be placed within the backed InfoPath code, although just like before I'm going to try doing this with a web part. Speaking of which, I was able to remove the Excel digital signatures using a web part however it prompted for each signature that was to be removed and there is no way to get rid of that prompt so that sucked.

Anyway, here is how to do it in InfoPath. Basically get the signature node, go to the signature child of that node and delete it.

XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();

if(this.Signed) //then unsign it
{
XPathNavigator xSignedSection = xnDoc.SelectSingleNode("my:myFields/my:signatures1/my:signatures2", this.NamespaceManager);

if (xSignedSection.HasChildren)
{
xSignedSection.MoveToChild(XPathNodeType.Element); xSignedSection.DeleteSelf();
}

}

Microsoft .NET RegEx Syntax Regular Expressions

I found a very nice cheat sheet for regular expression syntax. I have to admit I sucked at this in college and still hate it. Pages like these were built for people like me.

http://regexlib.com/CheatSheet.aspx

Programmatically Post to ASP page and read results

I want to be able to POST some values to an external web site's ASP page and then programmatically read the results. The external page has no query string paramaters so I can't just create the url and read the page instead I need to create some web requests and deal with that object. This is how I did it, basically a mash up of what I found on the web but I believe more concise and clear.

//set our data
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "firstname=" + fname.Text;
postData += ("&lastname=" + lname.Text);

//compose the submission
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://somepage.asp");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = postData.Length;

// Post to the form.
StreamWriter swRequestWriter = new StreamWriter(request.GetRequestStream());
swRequestWriter.Write(postData);
swRequestWriter.Close();

//get the response
HttpWebResponse hwrWebResponse = (HttpWebResponse)request.GetResponse();

// Read the response
StreamReader srResponseReader = new
StreamReader(hwrWebResponse.GetResponseStream());
string strResponseData = srResponseReader.ReadToEnd();
srResponseReader.Close();

// Display the response on my page
Response.Write(strResponseData);

Now what I plan to do is screen scrape the result page and get the data I need. Ah regular expressions, I hate those. Stay tuned for that post in the next couple of days...

Thursday, July 24, 2008

Creating a SharePoint stsadm command prompt on the dektop

Create a quick shortcut to the stsadm command prompt for your SharePoint server.


http://blogs.msdn.com/scicoria/archive/2008/07/24/creating-a-wss-moss-command-prompt-on-the-desktop.aspx

Finding the SQL behind a Crystal Report

I need to find the SQL that generated a Crystal Report. All I had was the report definition file and Visual Studio 2008.

After creating a new DSN (Windows XP users click here for instructions) I opened up the report in VS and clicked the Crystal Reports menu at the top. Then Database -> Show SQL Query. A wizard will popup, click the Back button, choose the newly created DSN for your database and then click Next. Login with your credentials and click Finish. Whalla (spelling??) I now see the previously hidden SQL.

InfoPath Percentage Symbol Field

This applies to InfoPath 2007 as well.

That's just wrong:

Note Microsoft Office InfoPath 2003 does not add percent symbols to numbers that are formatted as percentages. To add a percent symbol to a control's label, click where you want the percent symbol to appear, and then type %.

http://office.microsoft.com/en-us/infopath/HP010938331033.aspx

Wednesday, July 23, 2008

Programmatically remove digital signatures from Excel document

Here is some sample code to remove all digital signatures from an Excel workbook. This can be run from a Windows app or Console app. I'm going to try to make it work within a SharePoint document library event handler. That should be interesting. Basically the idea is to have a document library that has a bunch of documents that are digitally signed and then every month get reset by removing all the digital signatures. Hope this runs in the event handler.

Microsoft.Office.Interop.Excel.Application eApp = null; Microsoft.Office.Interop.Excel.Workbook wb = null;

//gets our workbook
eApp = new Microsoft.Office.Interop.Excel.Application();
wb = eApp.Workbooks.Open(textBox1.Text, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);

//makes it visible and activates the workbook

//eApp.Visible = true;
//wb.Activate();

//get signatures

Microsoft.Office.Core.SignatureSet sigs = wb.Signatures;

//remove all the signatures

foreach (Microsoft.Office.Core.Signature sig in sigs)
{ sig.Delete(); }

//save and close the form

wb.Save();
wb.Close(Type.Missing, Type.Missing, Type.Missing);
wb = null;
eApp = null;

Tuesday, July 22, 2008

Sample valid credit card numbers

I often need to test my forms with credit card information, so here are some valid numbers for each type of card, although I doubt they will work in reality but they pass the Luhn Algorithm for my testing.

Visa
4111 1111 1111 1111

MasterCard
5500 0000 0000 0004

American Express
3400 0000 0000 009

Discover
6011 0000 0000 0004

EmailSubmitConnection :How to add custom email to an InfoPath email data connection EmailSubmitConnection

EmailSubmitConnection : Often times I need to add some more information to an email that is sent from InfoPath besides just a view of the form. Sometimes I want to add fields and such to the body of the email but just end up adding the fields to the subject line since there is no way without writing code to include fields in the introduction field of the email. I hope with Office 14 they make this possible without writing code, but for right now let's see how to do it.

First, you need to create a data connection (EmailSubmitConnection) that sends an email to someone within the InfoPath data connections. This data connection needs to be created so we can reference it in our code.

Second get into the code behind of the form, I'm using C# for InfoPath 2007 so those with InfoPath 2003 may have to figure this out for themselves but hopefully this gives them some clues.

Within, probably a button click event, I get a reference to the email data connection. The "email connection" is the name of the data connection I created in the first step.

EmailSubmitConnection emailDataConnection = (EmailSubmitConnection)this.DataConnections["email connection"];

//add your custom message to the introduction, say hello to yourself
XPathNavigator xnDoc = this.MainDataSource.CreateNavigator();
XPathNavigator fullName = xnDoc.SelectSingleNode("my:myFields/my:txtFullName", this.NamespaceManager);
emailDataConnection .Introduction = "My custom introduction with some fields. Hello " + fullName.Value;

//submit the data connection which sends the email
emailDataConnection .Execute();

As you can see, just get a reference to the data connection (EmailSubmitConnection), set the Introduction property and execute. This can also be accomplished for the FileSubmitConnection and WebServiceConnection objects, so you can write code to execute these connections and set some custom properties before making the submit. Hope this helps someone.

Monday, July 21, 2008

Funny video for developers

Stupid sales people should learn how to use the software they are selling. I can't tell you how many times I had to help people learn about the MS software that they had no idea how to use but were trying to sell it to our clients.

http://www.thewebsiteisdown.com/

InfoPath Rules vs Code

When writing custom code behind for an InfoPath form you should keep in mind that when used on a button with other rules that the rules will run before the code. This means that if one of your rules "Closes the form" that your code will have to do this instead, otherwise the rule will close the form and your code will never run.

There is no way to switch the OoE or Order of Execution within InfoPath. Here is a sample to close the form in code in a js script code behind. There is also no need to sign the form unless the code interacts with the SharePoint OM.

Application.XDocuments.Close(0); //will close form but keep InfoPath open

Application.Quit(bool) //will exit InfoPath and if true force an exit, if false will prompt user if they want to save the form

I used true because in a rule I submit the form so the code can go ahead and quit InfoPath.

Tuesday, July 15, 2008

Installation Instructions for Sitecore CMS 6

Sitecore has not provided a migration path from v5.3 to v6 and therefore a lot of Sitecore users cannot upgrade to the latest and greatest. I think this is unacceptable.

Here are screenshots of the Sitecore 6 installation process in case you ever get there.

Sitecore 6 Installation Screenshots

Programmatically create folder within SharePoint List

So simple yet somewhat not obvious.

SPList list = {some SPList object}
SPListItem folder = list.Items.Add(string.empty, SPFileSystemObjectType.Folder, "Name of folder to create");

Monday, July 14, 2008

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)

This error:

Login failed for user 'username'. The user is not associated with a trusted SQL Server connection. (Microsoft SQL Server, Error: 18452)


Most likely indicatest that your SQL Server is not enabled for Mixed Mode authentication, it is probably only allowing Windows logons to log onto it, make it mixed mode and then you'll be able to connect using your SQL server login account. Quick fix but unknown unless you have this information.

Friday, July 11, 2008

Import SharePoint v3 sites using stsadm -o import, replacement for smigrate

So now that you've successfully exported a WSS v3 site we need to figure out how you can import it into another WSS site or into a WSS site sitting underneath your MOSS 2007 site. Again, the export gives us some functionality that smigrate did not, mainly the ability to import user security from our exported file. Here is the command line instructions:

stsadm.exe -o import -url

-filename

-includeusersecurity

-haltonwarning

-haltonfatalerror -updateversions <1-4>

1 - Add new versions to the current file

2 - Overwrite the file and all its versions

3 - Ignore the file

4 - Terminate with conflicts

-quiet

And here is an example:

stsadm.exe -o import -url http://officepoint.blogspot.com/SiteDirectory/NewlyImportedSite -filename C:\backups\officepoint.blogspot.com.bak -includeusersecurity -haltonfatalerror -updateversions 1

This will import my backup file named officepoint.blogspot.com.bak to the site named NewlyImportedSite that sites beneath my MOSS site, it will, of course, include all of the user security from the exported site, it will stop importing if it encounters a fatal error and will update the versions of the site instead of deleting them and replacing them.

WSS (SharePoint) v3 stsadm.exe -o export, replacement for smigrate

We all know that WSS v2 lacked the ability to migrate sites and include the user security in that migration. You could use smigrate to move a site but you would lose all of the users and the user security during the process. Well in SharePoint version 3 Microsoft has developed this ability. It is now possible to backup a WSS site using stsadm and restore it, with all security in tact, to another WSS instance or as I found out even to a WSS site underneath MOSS 2007. This is how you perform the export of your site and include the security.

stsadm.exe -o export -url
-filename
-overwrite
-includeusersecurity
-haltonwarning
-haltonfatalerror
-versions <1-4>
1 - Last major version for files and list items
2 - The current version, either the last major or the last minor
3 - Last major and last minor version for files and list items
4 - All versions for files and list items
-cabsize
-quiet

So an example of this would be:

stsadm.exe -o export -url http://officepoint.blogspot.com -filename C:\backups\officepoint.blogspot.com.bak -overwrite -includeusersecurity -haltonfatalerror -versions 2 -quiet

This will export the WSS located at http://officepoint.blogspot.com to a file named officepoint.blogspot.com.bak in the backups folder on my C: drive. It will overwrite any backup files already there. It will include all of the user security of the site. It will stop the export if it hits a fatal error, it will perform a quiet export and export the current version of the site.

It takes a little longer to run because of all the extra web parts and lists created with WSS v3, but it'd definitely nice to have this ability. The only question I can think of is, if I copy the stsadm executable to a WSS v2 site, will it export v2 sites with their security or is this functionality only limited to version 3?

Free favicon for your site

This is the site I use to get free favicon.ico images for my sites.

http://www.favicon.cc/

It has a nice search feature along with a bunch of other ones I don't use.

SQL Server Reporting Services SharePoint Set Server Defaults

Trying to configure Reporting Services 2005 with an existing SharePoint site is painful to say the least. One of the pains was the error below when clicking on "Set Server Defaults" under Application Management within Central Admin. After searching through some forums, I found a solution

I when to the Operations tab in Central Admin and clicked "Alternate access mappings" and then selected the Central Admin collection and removed all mappings except for the default one. Then went back to "Set Server Defaults" and the error went away. I could then go back and add my mappings back in and the error still did not show.

I can't explain and really don't want to know the internal workings of Reporting Services with SharePoint but the above solution worked for me, hope it works for you too.

w3wp!library!5!07/11/2008-13:03:58:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ; Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---> System.ArgumentException: Value does not fall within the expected range. at Microsoft.ReportingServices.SharePoint.Server.Utility.GetSPItemMetaDataAndContent(String path, UserContext userContext, Boolean returnContent, Guid& id, ISecurableObject& secObj, SharePointImpersonatedWeb& wrapper, Byte[]& content, String& mimeType) at Microsoft.ReportingServices.SharePoint.Server.Utility.GetSPItemType(String objectName, UserContext userContext, Guid& id, ISecurableObject& secObj, SharePointImpersonatedWeb& wrapper) at Microsoft.ReportingServices.SharePoint.Server.SharePointAuthorizationExtension.InternalCheckAccess(UserContext userContext, String itemPath, SPBasePermissions requiredRights) at Microsoft.ReportingServices.SharePoint.Server.SharePointAuthorizationExtension.CheckAccess(UserContext userContext, String path, CatalogOperation requiredOperation) at Microsoft.ReportingServices.SharePoint.Server.SharePointSecurity.CheckAccess(Byte[] secDesc, CatalogOperation catalogOperation, String catalogPath) at Microsoft.ReportingServices.Library.GetSystemPropertiesAction.PerformActionNow() at Microsoft.ReportingServices.Library.RSSoapAction`1.Execute()

Wednesday, July 9, 2008

Enable InfoPath autocomplete feature

This feature is actually part of IE and needs to be enabled within IE. This seems sort of odd because not all InfoPath forms are web based but also kind of nice because the setting is in one place. Here are the steps:

Within IE go to the tools menu, click Options, and then click the General tab.
Under System options, click Internet Options, and then click the Content tab.
Under Personal information, click AutoComplete.

You should be able to set your autocomplete settings from that configuration.

This came from http://office.microsoft.com/en-us/infopath/HP010967791033.aspx

Tuesday, July 8, 2008

Outlook Business Contact Manager (BCM) Custom Import Tool Update #1

This is the heart of my import tool. It doesn't import or create projects but I imagine the process is very similar. Probably instead of the line "Outlook.Folder accounts = (Outlook.Folder)bcmRootFolder.Folders["Accounts"]" you may want to use something like "Outlook.Folder projects = (Outlook.Folder)bcmRootFolder.Folders["projects"]" or whatever the projects folder is named. And then create a Outlook.ContactItem newProject = (Outlook.ContactItem)projects.Items.Add("IPM.Contact.BCM.Project"). Something like that, you may need to play around with it to figure out exactly how to create that project object but once you get it you should be able to set properties on it like I've done with the account object below.




Outlook.ApplicationClass _app = new Outlook.ApplicationClass();
Outlook.Application olApp = (Outlook.Application)_app;
Outlook.NameSpace olNameSpace = _app.GetNamespace("MAPI");
Outlook.Folders folders = olNameSpace.Session.Folders;
Outlook.Folder bcmRootFolder = (Outlook.Folder)folders["Business Contact Manager"];
Outlook.Folder accounts = (Outlook.Folder)bcmRootFolder.Folders["Accounts"];
Outlook.UserProperty userProp;
foreach (StringDictionary account in accountList)
{
Outlook.ContactItem newAccount = (Outlook.ContactItem)accounts.Items.Add("IPM.Contact.BCM.Account");
newAccount.FullName = account["accountname"].Trim();
newAccount.FileAs = account["accountname"].Trim();
newAccount.OfficeLocation = account["officelocation"].Trim();
newAccount.Save();
//populate the account number
if (newAccount.UserProperties["Account Number"] == null)
{
userProp = newAccount.UserProperties.Add("Account Number", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
userProp.Value = account["accountnumber"].Trim();
}
//populate the active flag
if (newAccount.UserProperties["Active"] == null)
{
userProp = newAccount.UserProperties.Add("Active", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olYesNo, false, false);
userProp.Value = account["inactive"].Trim();
}
//populate the type of business
if (newAccount.UserProperties["Type of Business"] == null)
{
userProp = newAccount.UserProperties.Add("Type of Business", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olText, false, false);
userProp.Value = account["contacttypeid"].Trim();
}
//populate the business address
if (account["address2"].Trim() != string.Empty)
{
StringBuilder sbBusinessAddressStreet = new StringBuilder();
sbBusinessAddressStreet.AppendLine(account["address1"].Trim());
sbBusinessAddressStreet.AppendLine(account["address2"].Trim());
newAccount.BusinessAddressStreet = sbBusinessAddressStreet.ToString();
}
else
{
newAccount.BusinessAddressStreet = account["address1"].Trim();
}
newAccount.BusinessAddressCity = account["city"].Trim();
newAccount.BusinessAddressState = account["state"].Trim();
newAccount.BusinessAddressPostalCode = account["zipcode"].Trim();
newAccount.BusinessAddressCountry = account["country"].Trim();
//add phone and fax info
newAccount.BusinessTelephoneNumber = account["companyphone"].Trim();
newAccount.BusinessFaxNumber = account["faxnumber"].Trim();
newAccount.WebPage = account["webpageaddress"].Trim();
//custom user defined field
}

if (newAccount.UserProperties["Business Card On File"] == null)
{
userProp = newAccount.UserProperties.Add("Business Card On File", Microsoft.Office.Interop.Outlook.OlUserPropertyType.olYesNo, false, false);
userProp.Value = account["cardonfile"].Trim();
}
//add other information
newAccount.Body = account["comments"].Trim();
newAccount.Save();

Monday, July 7, 2008

InfoPath Form Template Format Structure Specification

Well I found this spec from MS regarding InfoPath, just updated the last week of June 2008. Their spec still indicates that the date picker button has a tab index of -1 instead of (tabIndex="TAB_INDEX")? like the other controls.

http://download.microsoft.com/download/8/5/8/858F2155-D48D-4C68-9205-29460FD7698F/%5BMS-IPFF%5D.PDF

I wonder if they haven't had complaints about this or if there is a technical reason why -1 is hardcoded as the tabindex of that control.

InfoPath Tabbing bug - Update #1

I saved the form as its source files and broke open the guts of the form. Looking at View1.xsl (since I didn't rename the default view), I found this by the date picker control.

button class="xdDTButton" title="" xd:xctname="DTPicker_DTButton" xd:innerCtrl="_DTButton" tabIndex="-1">
img title="" src="res://infopath.exe/calendar.gif"/
/button


This button is the small calendar image that when clicked opens up the date picker control. As you can see this has a tabIndex of -1 instead of the 12 that the control should have. Below is the span associated with the text portion of the date picker. Notice how that has the correct tab index.

span class="xdDTText xdBehavior_FormattingNoBUI" hideFocus="1" title="" contentEditable="true" tabIndex="12" xd:xctname="DTPicker_DTText"

MS should have made the button have a tab index of 12 too so that the next tab action goes to the next field instead of dropping down to the rest of the form.

Next question, can I change the source files without breaking the rest of the form?? What about Drop Down Lists and Radio buttons? I suspect the same thing is happening...

Remove Warning - this form is using your identity to connect to data sources

When connecting to a web service or SQL server from InfoPath client forms that you access from a SharePoint site you may receive this warning each time you open the form.

"This form is using your identity to connect to data sources"

This gets really annoying and your users may be confused. So advise them to Enable Access data sources across domains within IE -> Security Settings. The form should be within a Trusted Site or within the Local Intranet Zone so this should be ok because group policy should dictate what sites are in these zones, and if your IT group is good only very very safe sites should be in those zones, like for instance your local SharePoint intranet site.

Thursday, July 3, 2008

Ajax Loading Image

This is a nice site that is giving away free ajax loader images. You can customize your own and then just download it.

http://www.ajaxload.info/

Give your site that cool Web 2.0 look and feel with ajax and the cool ajax loading images.

Web Based Link Checker

I currently use LinkAlarm to check my web site for broken links, this service has worked great but it eats into my yearly budget. I found a nice example of how to write my own link checker at the following site.

http://blogs.iis.net/tomkmvp/archive/2008/06/26/web-based-link-checker.aspx

As soon as I get some time I will start working on this application and should be able to modify it to fit my needs. Basically go through my entire site, check links and produce a report of what needs to be fixed.

Install SharePoint on Vista

We (SharePoint developers) have always had to either develop on a server or spin up our vpcs or vm images with server running on it to develop SharePoint applications. There is now a solution to this. Check out http://community.bamboosolutions.com/blogs/bambooteamblog/archive/2008/05/21/how-to-install-windows-sharepoint-services-3-0-sp1-on-vista-x64-x86.aspx

for information regarding the steps needed to install and configure SharePoint to run on Windows Vista. Finally, we can develop on our local machines without the heavy server image.

On a personal note, I am going to continue to develop on my vpc image. My reason being Vista is slow enough without SharePoint and SQL running on it, developing on a server image gives me a better chance that my application will run without issues when deployed to the SharePoint server and the big one, the installation of SharePoint on Vista is not supported by Microsoft.

Wednesday, July 2, 2008

Kayak Club of Ada

My wife and I love to kayak the Thornapple and Grand River around Ada, MI and I think it would be great to share this experience with others around us. So I've set up a site for a potential kayak club based in Ada, MI. The idea would be to get others involved in kayak trips in the morning, evenings or entire days. It would be great to have a group of people that share our love of the water. I imagine this club would one day also sponsor some sort of river cleanup.

Speaking of river cleanup, I found a full size 16 speed Rally bike in the Thornapple behind the florist shop yesterday evening. I couldn't pull it out since I was on the kayak and probably would have fallen it, but I plan to get it out. Unless someone else sees this post and does it before me.

Anyway, the link to the kayak blog is http://kayakada.blogspot.com/ Please drop us a line if you'd like to participate with us.

InfoPath Tabbing Tab Index bug

I have an InfoPath form with controls defined below.


TextBox - Tab Index is 1

TextBox - Tab Index is 2

Date Picker - Tab Index is 3

TextBox - Tab Index is 4

TextBox - Tab Index is 0


If I tab through these fields, it goes down the line 1, 2, 3, 4, 0 as expected. However, if I tab from 1 to 2, 2 to 3 and then choose a date using the calendar and then tab again it goes down to the textbox with tab index of 0.

Why does this happen? Because the small calendar icon seems to be it's own control and gets focused on, it's tab index is presumably 0 even though the entire Date Picker control is 3. So when I tab from the calendar icon it goes to the next tab index of 0 which is expected. However, this is not an expected behavior from a user perspective or from any other perspective for that matter.


That entire Date Picker control should have a tab index of 3 not just the text portion of the control but the entire control including the small calendar icon.


This same behavior seems to occur for radio buttons and drop down controls as well. If instead you replace the Date Picker with a Drop Down control and the user selects a value, the next tab is to a control with a tab index of 0, even though it's expected that it should be 4 (using the example above).

I would consider this a bug that needs to be fixed for Office 14. Probably not important enough for them to fix it in a service pack for Office 2007, even though that would be nice.

Tuesday, July 1, 2008

Grand Rapids Tech Lunch #2 - July 7, 12pm Grand Rapids Brewing Company

My fellow colleague, Joel Ross, has put together a Grand Rapids Tech Lunch. What a great idea! This time the lunch will be held at the Grand Rapids Brewing Company on 28th street. Last time I was at TechEd, this time I've got a meeting at 1pm I need to attend, so I won't be able to make it again. But I encourage you to go if you are in GR and want to meet other developers.

http://grtechlunch.com/grafitti/meetings/2-grtechlunch-event-july-7-2008-grand-rapids-brewing-company/

Outlook Business Contact Manager (BCM) Custom Import Tool

BCM is a great tool provided by Microsoft to manage business contacts and vendors. It can be used as a sales tool or to keep track of approved vendors. Most of you probably have this data stored within an ACT! database, an Access database, an Excel spreadsheet or some other format. If you have ever tried to import this data into BCM you'll quickly find that it's not as customizable as it should be.

Now I don't know what version BCM is, I know it was at least around with Office 2003, but it could be improved dramatically. One improvement could be the import tool. My requirement was to import an Access database into BCM into custom fields. The Microsoft import tool did not fit my needs to I wrote my own import tool to do this. I can see from the newsgroup and complaints that a custom import tool may be desired by a lot of people.

If this is the case for you, please drop me a line. I'm more than happy to release the tool I've created so that it may help you. It is easy to custom to fit your needs with a little bit of development.