<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:admin="http://webns.net/mvcb/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <channel>
    
    <title>Blog</title>
    <link>http://brantas.dev2.ocean70.com/index.php</link>
    <description>Brantas Blog</description>
    <dc:language>en</dc:language>
    <dc:creator>mauro.masucci@brantas.co.uk</dc:creator>
    <dc:rights>Copyright 2010</dc:rights>
    <dc:date>2010-03-10T15:22:02+00:00</dc:date>
    <admin:generatorAgent rdf:resource="http://expressionengine.com/" />
    

    <item>
      <title>SharePoint 2010 and Office 2010 Launch Dates</title>
      <link>http://www.brantas.co.uk/blog/sharepoint-2010-and-office-2010-launch-dates/</link>
      <guid>http://www.brantas.co.uk/blog/sharepoint-2010-and-office-2010-launch-dates/#When:14:22:02Z</guid>
      <description>The official date of Microsofts next Office release (Office 2010) and SharePoint 2010 including SharePoint Foundations will be 12 May 2010 &#45; we&#8217;ll get to play with the RTM versions before then so keep an eye out for updates on new functionality, features and gotcha&#8217;s with the new software here.

You can read more about the launch here: SharePoint 2010 @ Microsoft.com</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2010-03-10T14:22:02+00:00</dc:date>
    </item>

    <item>
      <title>CRM Report Dates &#45; Current Format UK</title>
      <link>http://www.brantas.co.uk/blog/crm-report-dates-current-format-uk/</link>
      <guid>http://www.brantas.co.uk/blog/crm-report-dates-current-format-uk/#When:07:56:15Z</guid>
      <description>Today we had an issue with a report and its related subreport in CRM 4.0, specifically that the report wouldn&#8217;t run and we were receiving the following message&#8230;

&amp;nbsp;&amp;quot;The sub report could not be shown&amp;quot; &amp;nbsp;

Looking at the reporting services log on the server, we could see the following error, leading us to believe that the problem was a result of a date field being passed between the main report and its related sub&#45;report, ...

&amp;nbsp;w3wp!processing!7!11/17/2009&#45;08:53:56:: e ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the data set _MSCRM., ;Info: Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Cannot read the next data row for the data set _MSCRM. &#45;&#45;&#45;&amp;gt; System.Data.SqlClient.SqlException: Arithmetic overflow error converting expression to data type datetime.&amp;nbsp;

This problem however was only being experienced on certain machines. Looking at the specifics of these machines we could see that the machines affected were those who had their CRM Current Format set as English (United Kingdom), those machines who had their current format as the default English (United States) could run the report without any issue.

The only date related functionality we had in the report was a string parameter in the main report which held a date value, this was being passed from the main report to the sub&#45;report and was used to compare against a datetime field in the sub&#45;report. The source dataset of the date string parameter was as follows&#8230;

&amp;nbsp;DECLARE @DateRange AS Table&#40;	Period VARCHAR&#40;14&#41;,	EndDate DATETIME&#41;&amp;nbsp;INSERT INTO @DateRange &#40;Period, EndDate&#41;VALUES&#40;&#39;Current Month&#39;, DATEADD&#40;WEEK, 3, GETDATE&#40;&#41;&#41;&#41;&amp;nbsp;SELECT EndDate FROM @DateRangeWHERE Period = &#39;Current Month&#39;&amp;nbsp;

Looking at the above sql I could see that the datetime value was being pulled directly from the sql (therefore it would be in american format, potentially causing issues on british format CRM browsers), so I therefore decided to change this to ensure the date was in the more generic ISO format of yyyymmdd.
I therefore changed the SQL to the below, replacing one line with a CONVERT statement, shown below&#8230;

&amp;nbsp;DECLARE @DateRange AS Table&#40;            Period VARCHAR&#40;14&#41;,            EndDate DATETIME&#41;&amp;nbsp;INSERT INTO @DateRange &#40;Period, EndDate&#41;VALUES&#40;&#39;Current Month&#39;, DATEADD&#40;WEEK, 3, GETDATE&#40;&#41;&#41;&#41;&amp;nbsp;SELECT CONVERT&#40;varchar,EndDate,112&#41; AS EndDateFROM @DateRangeWHERE Period = &#39;Current Month&#39;&amp;nbsp;

After modifying the dataset as per the above and re&#45;uploading the report it worked without issue, as I had removed the dependancy on an American date format which didn&#8217;t agree with any English (United Kingdom) format CRM browsers.</description>
      <dc:subject>CRM, SQL 2005, SQL Reporting Services</dc:subject>
      <dc:date>2009-11-18T07:56:15+00:00</dc:date>
    </item>

    <item>
      <title>Hyper V &#45; The authentication certificate has expired or is invalid</title>
      <link>http://www.brantas.co.uk/blog/hyper-v-the-authentication-certificate-has-expired-or-is-invalid/</link>
      <guid>http://www.brantas.co.uk/blog/hyper-v-the-authentication-certificate-has-expired-or-is-invalid/#When:08:06:15Z</guid>
      <description>On resetting a dev machine on Hyper&#45;V after setting up a Windows 2008 machine we found that we could no longer connect to a virtual machine.

The Hyper&#45;V console told us that &#8220;The authentication certificate has expired or is invalid&#8221; &#45; I found this helpful forum entry.&amp;nbsp;  The issue is that the self issued certificate had expired.&amp;nbsp; To re&#45;create a new certificate I deleted the old certificate and then restarted the Hyper&#45;V Management service to regenerate the certificate.</description>
      <dc:subject>Windows Server</dc:subject>
      <dc:date>2009-11-17T08:06:15+00:00</dc:date>
    </item>

    <item>
      <title>Brantas Customer Access Portal (BCA)</title>
      <link>http://www.brantas.co.uk/blog/brantas-customer-access-portal-bca/</link>
      <guid>http://www.brantas.co.uk/blog/brantas-customer-access-portal-bca/#When:09:45:24Z</guid>
      <description>This week we&#8217;ve launched the Brantas Customer Access Portal, if you are a customer with a registered support agreement you will be able to easily view and maintain your active cases.&amp;nbsp; 

How have we done this?&amp;nbsp; We&#8217;ve integrated our support management system (Dynamics CRM) with the eService Accelerator for CRM from codeplex, mix that with Brantas&#8217; knowledge of web technologies (including ASP.Net, CSS and xHTML) and the result is a fully branded, customised portal for our customers.



We&#8217;re also currently working on a SharePoint Designer Activity tutorial to go on the site later this week.</description>
      <dc:subject>System Integration, Web Development</dc:subject>
      <dc:date>2009-10-14T09:45:24+00:00</dc:date>
    </item>

    <item>
      <title>SharePoint prompts for login credentials</title>
      <link>http://www.brantas.co.uk/blog/sharepoint-prompts-for-login-credentials/</link>
      <guid>http://www.brantas.co.uk/blog/sharepoint-prompts-for-login-credentials/#When:07:02:11Z</guid>
      <description>SharePoint (MOSS2007) prompts users to login in when accessing SP using a fully qualified domain name (FQDN) on Windows Vista.

The resolution is document in Microsoft Support</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2009-09-22T07:02:11+00:00</dc:date>
    </item>

    <item>
      <title>Email Enabled Document Libraries in MOSS 2007 on Windows 2008</title>
      <link>http://www.brantas.co.uk/blog/email-enabled-document-libraries-in-moss-2007-on-windows-2008/</link>
      <guid>http://www.brantas.co.uk/blog/email-enabled-document-libraries-in-moss-2007-on-windows-2008/#When:13:10:28Z</guid>
      <description>We were trying to configure Email Enabled Document Libraries in MOSS 2007 and all was going really well until actually configuring a document library to accept emails.&amp;nbsp; 

Every time I ran the Incoming Email Settings page and clicked OK I was presented with an ACCESS DENIED error from the web service.&amp;nbsp; Great! Windows 2008 was at it again.&amp;nbsp; It might be a lot more secure but its not kind to those who have to administer it on a daily basis.

Eventually I tracked down a post which showed I had to use a command CACLS to set permissions on the IIS Metabase &#45; Application Pool accounts have no administrative access over this and the CACLS command is a way to allow the required level of access.

CACLS is deprecated in Windows 2008, instead you should use ICACLS &#8220;%SystemDrive%WindowsSystem32inetsrvconfigapplicationHost.config&#8221; /grant &amp;lt;domain&amp;gt;&amp;lt;UserAccount&amp;gt;:(D,WDAC)

&amp;nbsp;</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2009-08-06T13:10:28+00:00</dc:date>
    </item>

    <item>
      <title>Fiscal year reporting in SQL Reporting Services (and CRM)</title>
      <link>http://www.brantas.co.uk/blog/fiscal-year-reporting-in-sql-reporting-services-and-crm/</link>
      <guid>http://www.brantas.co.uk/blog/fiscal-year-reporting-in-sql-reporting-services-and-crm/#When:18:42:38Z</guid>
      <description>Most financial and sales related reports done in CRM and Sql Reporting Services are based on the fiscal year but how do you find the start and end of the current year? fear not  , this blog post shows you the way ...
The first thing to do is get the current month:


SET @CurrentDate = GetDate&#40;&#41;SET @CurrentMonth = Month&#40;@CurrentDate&#41;

Then its just a case of setting the start and end of the fiscal year according to whether the month falls in the last quarter (Jan, Feb, Mar) or the first three quarters (April thru to Dec):

IF @CurrentMonth &amp;gt;= 4BEGIN	SET @FiscalYearStart = DATEADD&#40;mm, 3, DATEADD&#40;yyyy, DATEDIFF&#40;yyyy, 0, @CurrentDate&#41;, 0&#41;&#41;	SET @FiscalYearFinish = DATEADD&#40;mm, &#45;1, DATEADD&#40;yyyy, 1, @FiscalYearStart&#41;&#41;ENDELSEBEGIN	SET @FiscalYearStart = DATEADD&#40;mm, &#45;9, DATEADD&#40;yyyy, DATEDIFF&#40;yyyy, 0, @CurrentDate&#41;, 0&#41;&#41;	SET @FiscalYearFinish = DATEADD&#40;mm, &#45;1, DATEADD&#40;yyyy, 1, @FiscalYearStart&#41;&#41;END

Hope this helps you in your report building duties  full code below:
Declare @CurrentDate AS DateTimeDeclare @CurrentMonth AS intDeclare @FiscalYearStart AS DateTimeDeclare @FiscalYearFinish AS DateTimeSET @CurrentDate = GetDate&#40;&#41;SET @CurrentMonth = Month&#40;@CurrentDate&#41;IF @CurrentMonth &amp;gt;= 4BEGIN	SET @FiscalYearStart = DATEADD&#40;mm, 3, DATEADD&#40;yyyy, DATEDIFF&#40;yyyy, 0, @CurrentDate&#41;, 0&#41;&#41;	SET @FiscalYearFinish = DATEADD&#40;mm, &#45;1, DATEADD&#40;yyyy, 1, @FiscalYearStart&#41;&#41;ENDELSEBEGIN	SET @FiscalYearStart = DATEADD&#40;mm, &#45;9, DATEADD&#40;yyyy, DATEDIFF&#40;yyyy, 0, @CurrentDate&#41;, 0&#41;&#41;	SET @FiscalYearFinish = DATEADD&#40;mm, &#45;1, DATEADD&#40;yyyy, 1, @FiscalYearStart&#41;&#41;ENDSELECT @FiscalYearStart, @FiscalYearFinish</description>
      <dc:subject>CRM, SQL Reporting Services</dc:subject>
      <dc:date>2009-07-28T18:42:38+00:00</dc:date>
    </item>

    <item>
      <title>Twitter Web Part for MOSS 2007</title>
      <link>http://www.brantas.co.uk/blog/twitter-web-part-for-moss-2007/</link>
      <guid>http://www.brantas.co.uk/blog/twitter-web-part-for-moss-2007/#When:09:28:43Z</guid>
      <description>We&#8217;ve now integrated Twitter and MOSS so that users never have to leave the portal to tweet.&amp;nbsp; Sounds useless right?&amp;nbsp; I mean all it does is post a message to your twitter page and get your twitter status back.&amp;nbsp; 
On MOSS/SharePoint 2007


On Twitter


Suppose though you have a tighly locked down network and dont want your users wasting their entire day on Twitter.&amp;nbsp; You can lock out access from Twitter altogether, but that means your users and staff may feel constrained at work and eventually their productivity may drop.&amp;nbsp; Why not allow them to update their Twitter using their own My Site?&amp;nbsp; It gives users apparent freedom to maintain their social circle yet because they are within your organisations MOSS Portal work is never far away.

Non&#45;Twitter users aren&#8217;t left out as they still get to see the Twitter status on the site, even though they may not have a username or password.


Use the Brantas Tweet web part on their mysite, your users will feel they have a bit of freedom, but at the same time you can ensure that users dont spend all day on Twitter.&amp;nbsp;</description>
      <dc:subject>Sharepoint, System Integration, Web Development</dc:subject>
      <dc:date>2009-07-27T09:28:43+00:00</dc:date>
    </item>

    <item>
      <title>Influenza A H1N1</title>
      <link>http://www.brantas.co.uk/blog/influenza-a-h1n1/</link>
      <guid>http://www.brantas.co.uk/blog/influenza-a-h1n1/#When:13:44:38Z</guid>
      <description>As the impact of swine flu on businesses increases and the NHS predicts a significant effect on business in autumn 2009, we would like to reassure you that Brantas is working proactively to prevent any impact on your business. 

To ensure we continue to deliver within the SLAs in our support agreements, we are taking the following preventative actions:

Environmental
Organisational
Individual behaviour


For more information please download the Brantas approach taken minimising the impact on our employees and customers.</description>
      <dc:subject>CRM, Sharepoint, System Integration</dc:subject>
      <dc:date>2009-07-21T13:44:38+00:00</dc:date>
    </item>

    <item>
      <title>Brantas now on Facebook and Twitter</title>
      <link>http://www.brantas.co.uk/blog/brantas-now-on-facebook-and-twitter/</link>
      <guid>http://www.brantas.co.uk/blog/brantas-now-on-facebook-and-twitter/#When:13:23:01Z</guid>
      <description>Brantas have joined Facebook and Twitter to communicate upcoming events and new developments.

Follow us on twitter.com/brantas
or
Poke us on facebook

Brantas LtdPromote your Page too</description>
      <dc:subject></dc:subject>
      <dc:date>2009-06-29T13:23:01+00:00</dc:date>
    </item>

    <item>
      <title>CRM 3.0 and IE8</title>
      <link>http://www.brantas.co.uk/blog/crm-3.0-and-ie8/</link>
      <guid>http://www.brantas.co.uk/blog/crm-3.0-and-ie8/#When:10:01:31Z</guid>
      <description>When accessing CRM 3.0 through IE 8 I was told that I had to &#8220;upgrade&#8221; to IE 6 SP1&#8230;surely this wasnt right?!

I tried running compatibility mode with no success&#8230;eventually out of sheer desperation I tried accessing the loader.aspx page directly and hey presto! it worked!

If you get the following error try changing your url to http://[servername]/loader.aspx instead of http://[servername]/

Unsupported Browser Version
 
Microsoft CRM requires Microsoft Internet Explorer 6 SP1 or later, running on a computer with Microsoft Windows XP, Microsoft Windows 2000, or Microsoft Windows Server 2003.
 
You need to upgrade your browser and try again.</description>
      <dc:subject>CRM</dc:subject>
      <dc:date>2009-06-12T10:01:31+00:00</dc:date>
    </item>

    <item>
      <title>Integrating Microsoft SharePoint Server 2007 and Apple Podcast Producer</title>
      <link>http://www.brantas.co.uk/blog/integrating-microsoft-sharepoint-server-2007-and-apple-podcast-producer/</link>
      <guid>http://www.brantas.co.uk/blog/integrating-microsoft-sharepoint-server-2007-and-apple-podcast-producer/#When:12:32:56Z</guid>
      <description>Apple &#45; Used by creative and design conscious people as it has a much easier on the eye interface.
Microsoft &#45; Used by companies as it gives administrative users control over the network with a much more manageable overhead.

Never the two shall meet&#8230;.until today that is.&amp;nbsp; Having to use undocumented calls was bad enough; having to use undocumented calls from a Microsoft.Net platform to a python/bsd Apple platform was even worse!&amp;nbsp; There was no way for us to code as you would by referring to an SDK instead we had to code by exception.&amp;nbsp; Using a code, compile, exception, re&#45;code cycle which took us far longer than we wanted, or anticipated.&amp;nbsp; Thankfully by using the http://www.xml&#45;rpc.net/ XmlRPC assemblies we were able to get it working.&amp;nbsp; I have to admit, this was actually a lot of fun despite it making me want to tear what little hair I have out.

The result?

A web part which allows a user to view authenticated RSS feeds from an Apple Podcast Producer server within Microsoft Office Sharepoint Server 2007 without ever having to navigate away from the site.



Rather than make the users have to enter the RSS feeds which they have access to manually, we decided to make it automatic, all the users need to do is provide their &#8220;Mac Open directory&#8221; credentials for the web part to authenticate with and the rest is done for you! 

Whats more, as you probably dont have a mac server published on the wide open internet, the webpart also introduces a proxy function which will fetch content without having to publish the podcast producer computer to all and sundry. 

&amp;nbsp;</description>
      <dc:subject>Sharepoint, System Integration</dc:subject>
      <dc:date>2009-04-22T12:32:56+00:00</dc:date>
    </item>

    <item>
      <title>Developing MOSS web parts on Vista or Windows XP</title>
      <link>http://www.brantas.co.uk/blog/developing-moss-web-parts-on-vista-or-windows-xp/</link>
      <guid>http://www.brantas.co.uk/blog/developing-moss-web-parts-on-vista-or-windows-xp/#When:12:15:42Z</guid>
      <description>Ok&#8230;so you have a perfectly good development machine and need to develop web parts or other Microsoft SharePoint items.&amp;nbsp; Microsoft have released Visual Studio extensions for WSS but we all know &#8220;you dont develop on a server&#8221;.&amp;nbsp; So you are left with two options, run a virtual machine &#45; which when you bog down with SQL, SharePoint and Visual Studio will run slower than a sloth thats fallen asleep or try to trick the visual studio extensions to work on your pc.

Its actually a lot easier than you think to get the VSe&#8217;s working on your pc than you think.

Disclaimer: this involved working on your registry.&amp;nbsp; If you dont feel comfortable editing your registry walk away now and get yourself a virtual machine.

Open Regedit as an administrator.
navigate to [HKEY_LOCAL_MACHINESOFTWAREMicrosoftShared ToolsWeb Server Extensions12.0] &#45; if any of these keys dont exist then you will have to create them.
Add a string value “Sharepoint”=”Installed”


Run the VSeWSS available from http://www.microsoft.com/downloads/details.aspx?FamilyID=7BF65B28&#45;06E2&#45;4E87&#45;9BAD&#45;086E32185E68&amp;amp;displaylang=en 

You will notice that we have now tricked the VSeWSS to thinking you have WSS installed on your pc.

Now&#8230;to make things even easier, download and install WSS deploy from http://wssdeploy.codeplex.com/ which will allow you to code and deploy more easily from your desktop without having to play around copying files, installing to GAC, carry out IISResets etc.

Happy Coding.</description>
      <dc:subject>Sharepoint, System Integration, Web Development</dc:subject>
      <dc:date>2009-04-07T12:15:42+00:00</dc:date>
    </item>

    <item>
      <title>Useful Links</title>
      <link>http://www.brantas.co.uk/blog/useful-links/</link>
      <guid>http://www.brantas.co.uk/blog/useful-links/#When:14:39:34Z</guid>
      <description>Today I was creating a development environment to mirror one of our client’s production MOSS installations and had to update our Development version of SharePoint to match the production version.

I found that the current SharePoint hotfixes from Microsoft don&#8217;t come via the update site but a useful blog pointed me to the right place:

http://Joerg Sinemus&#8217; Blog

Each hotfix for MOSS has to be registered for and Microsoft send a download link to your email with a password &#45; the good news is that the mail is sent pretty much instantaneously :0&#45;)

Anyway, I got to chatting with my colleague and we decided it would be a good idea to post a whole load of useful download links for installations and here they are:

Frameworks
1.1: http://Framework 1.1
2.0: http://Framework 2.0
3.0: http://Framework 3.0 
3.5: http://Framework 3.5 
 
You&#8217;ll also need the service packs:

Service Packs
1.1: http://.Net Framework 1.1  Service Pack 
2.0: http://.Net Framework 2.0 Service Pack
3.0: http://.Net Framework 3.0 Service Pack

Enjoy :0&#45;)</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2009-04-06T14:39:34+00:00</dc:date>
    </item>

    <item>
      <title>Caller does not have enough privilege to set CallerOriginToken to the specified value</title>
      <link>http://www.brantas.co.uk/blog/caller-does-not-have-enough-privilege-to-set-callerorigintoken-to-the-speci/</link>
      <guid>http://www.brantas.co.uk/blog/caller-does-not-have-enough-privilege-to-set-callerorigintoken-to-the-speci/#When:10:14:54Z</guid>
      <description>Today I had an issue with workflows on our CRM server, specifically that none of them would run, so in order to resolve the issue I looked at the trace log and found that we were receiving the following error&#8230;

&amp;nbsp;&amp;quot;Caller does not have enough privilege to set CallerOriginToken to the specified value&amp;quot; &amp;nbsp;

Looking at the CRM Asynchronous Service, I could see that it was running under the correct domain account (CRM Admin), however I discovered that this account needs to belong to a specific group in AD also (PrivUserGroup), so I then performed the following steps&#8230;

1. Open Active Directory and Computers (dsa.msc)
2. Find your PrivUserGroup
3. Open group and add your domain account running your CRM services
4. Run iisreset on CRM server.
5. Restart CRM Asynchronous Service.

And hey presto, workflows can then be ran on the server.</description>
      <dc:subject>CRM</dc:subject>
      <dc:date>2009-03-31T10:14:54+00:00</dc:date>
    </item>

    <item>
      <title>SSRS Putting totals at the end of the report</title>
      <link>http://www.brantas.co.uk/blog/ssrs-putting-totals-at-the-end-of-the-report/</link>
      <guid>http://www.brantas.co.uk/blog/ssrs-putting-totals-at-the-end-of-the-report/#When:12:15:59Z</guid>
      <description>To put a total at the end of the SSRS report, add a textbox to the DataSet Region and set the visibility property of the text&#45;box to an expression &#45; set the the expression to: 

=iif&#40;RowNumber&#40;&amp;quot;List1&amp;quot;&#41; = Count&#40;Fields!.Value&#41;,true,false&#41; 

Then a just set the expression on the text box to:

=&amp;quot;Total between &amp;quot; &amp;amp; Parameters!.Value &amp;amp; &amp;quot; and &amp;quot; &amp;amp;_Parameters!.Value + &amp;quot;: &amp;quot; &amp;amp; RowNumber&#40;&amp;quot;List1&amp;quot;&#41; 

and this is what it looks like rendered:



Enjoy!</description>
      <dc:subject>SQL Reporting Services</dc:subject>
      <dc:date>2009-03-27T12:15:59+00:00</dc:date>
    </item>

    <item>
      <title>App_Data &#45; Why oh why are you there?!!</title>
      <link>http://www.brantas.co.uk/blog/app_data-why-oh-why-are-you-there/</link>
      <guid>http://www.brantas.co.uk/blog/app_data-why-oh-why-are-you-there/#When:14:28:43Z</guid>
      <description>On deploying a site for a customer we were presented with all sorts of ASP.Net errors.&amp;nbsp; First I was told that the database was the incorrect type (i.e. the app thought it was SQL Express edition instead of the SQL Standard Edition).

provider: SQL Network Interfaces, error: 26 &#45; Error Locating Server/Instance Specified&#8221;



A network&#45;related or instance&#45;specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 &#45; Error Locating Server/Instance Specified) 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: A network&#45;related or instance&#45;specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 &#45; Error Locating Server/Instance Specified)

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[SqlException (0x80131904): A network&#45;related or instance&#45;specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 &#45; Error Locating Server/Instance Specified)]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4844759
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +4858065
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +90
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +376
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +4859187
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +499
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +65
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +117
System.Data.SqlClient.SqlConnection.Open() +122
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +87
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +221
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +760
System.Web.Security.RolePrincipal.IsInRole(String role) +164
System.Web.SiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +202
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +17
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +356
System.Web.SiteMapNode.get_ChildNodes() +27
System.Web.SiteMapNode.get_HasChildNodes() +7
System.Web.SiteMapNode.System.Web.UI.IHierarchyData.get_HasChildren() +7
System.Web.UI.WebControls.Menu.DataBindRecursive(MenuItem node, IHierarchicalEnumerable enumerable) +3042
System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +231
System.Web.UI.WebControls.Menu.PerformDataBinding() +50
System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +85
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.Menu.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.Menu.EnsureDataBound() +40
System.Web.UI.WebControls.Menu.CreateChildControls() +107
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842


To resolve the issue  I started looking at my database; you&#8217;d think that was the obvious place or not? I restored my database, that didnt work, I attached my MDF files, that didnt work, finally I even tried to build the database entirely using SQL Scripts; but still the app was telling me that the database was a SQL Express Schema.

In desperation, I searched my code for any references to .MDF which I may have had&#8230;nothing; I searched for connection strings &#45; no luck there either! What was going on?

Eventually &#45; for no reason other than to try attaching the .MDF file again; I did a file search on my dev machine and found that there was an ASPNET.MDF file present in the app_data folder.&amp;nbsp; Now, this shouldn&#8217;t be there, I was using my own database for roles based authentication.&amp;nbsp; So I deleted it.&amp;nbsp; Redeployed my site; and again was told there was no database&#8230;

I gave up on the host; clearly they were going to be no help so I set about replicating the environment on our own servers.&amp;nbsp; I set up the site; configured role memberships and disabled custom errors&#8230;on browsing the site; I was able to find out that the ASPNET user was trying to create a database in the App_Data folder; I have no idea why; so yet again I searched through all my source for any reference to App_Data that was there.&amp;nbsp; Nothing.&amp;nbsp; Absolutely no references.&amp;nbsp; So I deleted the Folder. 

As soon as I hit CTRL&#45;F5 the site worked&#8230;could this have been the error? All my problems seemed to have been caused by the ASPNET worker process trying to create a database in the App_Data folder even though it was never used.

I have yet to fathom out why ASP.Net decides to create a database in the APP_Data folder; but if its causing you problems you simply need to delete the folder (as long as you arent using it).

&amp;nbsp;</description>
      <dc:subject></dc:subject>
      <dc:date>2009-03-18T14:28:43+00:00</dc:date>
    </item>

    <item>
      <title>Kerberos Double Hop for Sharepoint/CRM</title>
      <link>http://www.brantas.co.uk/blog/kerberos-double-hop-for-sharepoint-crm/</link>
      <guid>http://www.brantas.co.uk/blog/kerberos-double-hop-for-sharepoint-crm/#When:13:47:17Z</guid>
      <description>On our Windows 2008 infrastructure we had a major issue trying to get CRM and SharePoint 2007 to work as we expected.&amp;nbsp; The main issue was down to the Kerberos double hop issue which is ever present in Windows 2008 (Microsoft love to make things difficult for us); after some errorlog tracing we were able to find that there were several duplicate SPN&#8217;s:

1.&amp;nbsp;  &amp;nbsp;   0x29 KRB_AP_ERR_MODIFIED
2.&amp;nbsp;  &amp;nbsp;   0x19 KDC_ERR_PREAUTH_REQUIRED
3.&amp;nbsp;  &amp;nbsp;   0xd KDC_ERR_BADOPTION 

I started by deleting the duplicate SPNs using the following commands

setspn &#45;d http/AD&#45;SRV.domain.com domaincrmadmin
setspn &#45;d http/AD&#45;SRV.domain.com domainsvcmosscontent
setspn &#45;d http/AD&#45;SRV.domain.com domainsvcmossssp
setspn &#45;d http/CRM&#45;SRV.domain.com domaincrmadmin
setspn &#45;d http/MOSS&#45;SRV.domain.com domainsvcmossssp

Next we found that some of the machine accounts weren&#8217;t functioning correctly for kerberos, it appeared that the SPNs for these had gone AWOL too, so I recreated them with the following commands: 
setspn &#45;R CRM&#45;SRV
setspn &#45;R MOSS&#45;SRV

MOSS and CRM still werent working but we were getting much more useful errors now, which led me to re&#45;create the correct SPNs:

setspn &#45;A http/CRM&#45;SRV domaincrmadmin
setspn &#45;A http/CRM&#45;SRV.domain.com domaincrmadmin
setspn &#45;A http/MOSS&#45;SRV domainsvcmossssp
setspn &#45;A http/MOSS&#45;SRV.domain.com domainsvcmossssp
setspn &#45;A MSSQLSvc/AD&#45;SRV.domain.com:1433 domaincrmadmin
setspn &#45;A MSSQLSvc/AD&#45;SRV.domain.com:1433 domainCRM&#45;SRV$
setspn &#45;A MSSQLSvc/AD&#45;SRV.domain.com:1433 domainMOSS&#45;SRV$
setspn &#45;A MSSQLSvc/CRM&#45;SRV.domain.com:1433 domaincrmadmin
setspn &#45;A MSSQLSvc/MOSS&#45;SRV.domain.com:1433 domainsvcmossssp
setspn &#45;A MSSQLSvc/MOSS&#45;SRV:1433 domainsvcmossssp

A quick server reset later and we were ready to go!&amp;nbsp; MOSS and CRM functioning as they should be!</description>
      <dc:subject>Web Development</dc:subject>
      <dc:date>2009-03-11T13:47:17+00:00</dc:date>
    </item>

    <item>
      <title>Publishing Project Server on MOSS 2007</title>
      <link>http://www.brantas.co.uk/blog/publishing-project-server-on-moss-2007/</link>
      <guid>http://www.brantas.co.uk/blog/publishing-project-server-on-moss-2007/#When:07:29:09Z</guid>
      <description>After installing Office 2007 Project Server on our MOSS 2007 box we were unable to provision the project access website as it was failing with the error message:

&#8220;The Project Application Service doesn&#8217;t exist or is stopped. Start the Project Application Service.&#8221;

To resolve it we had to first of all:

stsadm &#45;o provisionservice &#45;action start &#45;servicetype &#8220;Microsoft.Office.Project.Server.Administration.ProjectApplicationService, Microsoft.Office.Project.Server.Administration, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71E9BCE111E9429C&#8221; &#45;servicename ProjectApplicationService

Then provide the MOSS SSP Account with temporary administrative access to the DB server to allow it to generate the required dbs.</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2009-03-11T07:29:09+00:00</dc:date>
    </item>

    <item>
      <title>DoHash Helper using MS Enterprise libraries</title>
      <link>http://www.brantas.co.uk/blog/dohash-helper-using-ms-enterprise-libraries/</link>
      <guid>http://www.brantas.co.uk/blog/dohash-helper-using-ms-enterprise-libraries/#When:15:19:34Z</guid>
      <description>Here is some example/helper code to create a hash function using the Microsoft Enterprise Library.


&amp;nbsp;namespace YourApplication.Helper.Cryptography&#123;    public static class CryptographyHelper    &#123;&amp;nbsp;        public static string DoHash&#40;string Value&#41;        &#123;            MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider&#40;&#41;;            byte&#91;&#93; input;            byte&#91;&#93; output;&amp;nbsp;            string _salt = ConfigurationManager.AppSettings&#91;&amp;quot;salt&amp;quot;&#93;;&amp;nbsp;            //encrypt the password by hashing with the salt            input = System.Text.ASCIIEncoding.ASCII.GetBytes&#40;_salt + Value&#41;;            output = md5.ComputeHash&#40;input&#41;;            string hash = Convert.ToBase64String&#40;output&#41;;            return hash;        &#125;    &#125;&#125;</description>
      <dc:subject>Web Development</dc:subject>
      <dc:date>2009-03-10T15:19:34+00:00</dc:date>
    </item>

    <item>
      <title>WSE 2.0 in Visual Studio 2008</title>
      <link>http://www.brantas.co.uk/blog/wse-2.0-in-visual-studio-2008/</link>
      <guid>http://www.brantas.co.uk/blog/wse-2.0-in-visual-studio-2008/#When:15:15:38Z</guid>
      <description>I am working on a project where a service application needs to interface with a webservice that implements a WS&#45;Security authentication model. 

WSE 2.0 provides the functionality for message level authentication, however WSE 2.0 does not integrate with Visual Studio 2008.

In order to get this to work I created the proxies using the WSDL command line utility and changed the base class from System.Web.Services.Protocols.SoapHttpClientProtocol to Microsoft.Web.Services2.WebServicesClientProtocol.
Here is an example of the code to set the username and password for the request object.


namespace YourApplication.Helper&#123;    public static class RequestHelper    &#123;&amp;nbsp;        public static void PrepRequest&#40;WebServicesClientProtocol si&#41;        &#123;            //get username and password for service request from config file            string _password = ConfigurationManager.AppSettings&#91;&amp;quot;password&amp;quot;&#93;;            string _username = ConfigurationManager.AppSettings&#91;&amp;quot;username&amp;quot;&#93;;&amp;nbsp;            //create the user token            UsernameToken token = new UsernameToken&#40;_username, YourApplication.Helper.Cryptography.CryptographyHelper.DoHash&#40;_password&#41;, PasswordOption.SendHashed&#41;;&amp;nbsp;            //carry out the request            SoapContext requestContext = si.RequestSoapContext;            requestContext.Security.Tokens.Add&#40;token&#41;;&amp;nbsp;        &#125;    &#125;&#125;</description>
      <dc:subject>Web Development</dc:subject>
      <dc:date>2009-03-10T15:15:38+00:00</dc:date>
    </item>

    <item>
      <title>SQL: Access Denied even for Admins</title>
      <link>http://www.brantas.co.uk/blog/sql-access-denied-even-for-admins/</link>
      <guid>http://www.brantas.co.uk/blog/sql-access-denied-even-for-admins/#When:13:12:57Z</guid>
      <description>Occasionally you will find that your user account doesn’t have a default database associated with it, this will stop you logging into SQL using Windows Authentication regardless of being a local administrator.

To be able to log in do the following:

1. Create a local user (as you have administrative access this is fine)
2. Add the user to local administrators and to the SQL Server Users group something like this (SQLServer2005MSSQLUser$MACHINENAME$INSTANCENAME)
3. Restart the SQL Server
4. Log into the laptop as the new local user
5. Run SQL Server
6. Go to security and right click on the user account which does not have access to SQL Server and select properties
7. Set the default database as master
8. Set the user role as required 
9. Ensure that the user has access to the correct databases 
10. Click ok
11. Log out of the pc
12. Log in as the original user. 

You will now have access to log into the SQL Server.</description>
      <dc:subject>Web Development</dc:subject>
      <dc:date>2009-03-09T13:12:57+00:00</dc:date>
    </item>

    <item>
      <title>PublishingStartDate / PublishingExpirationDate Custom Navigation</title>
      <link>http://www.brantas.co.uk/blog/publishingstartdate-publishingexpirationdate-custom-navigation/</link>
      <guid>http://www.brantas.co.uk/blog/publishingstartdate-publishingexpirationdate-custom-navigation/#When:09:59:59Z</guid>
      <description>I&#8217;d recently written a SharePoint custom navigation object as the default functionality didn&#8217;t meet the customers needs. It tested out perfectly, only displaying pages which the user was able to see and which were also published.

When deployed on the live server though, no matter what I did, it simply wasn&#8217;t picking up the fact that some pages had been published, others had expired. It was displaying all content (apart from the hidden pages) in the publishing site.

What was going on

For too long I focused on the way the dates were being handled by my control&#8230;but surely the PortalSiteNavigation provider should take care of this?!?!?? I even went so far as to load the corresponding page item for each SiteMapNode in the SiteMapNodes collection then checking the PublishingStartDate and PublishingExpirationDate (Scheduled Start Date and Scheduled End Date) &#45; Imagine the hit on performance when I did that!

After a lot of hair ripping, and swearing I found the issue.

Stsadm extensions had been installed on the server&#45; I had used them a number of times to publish content en&#45;masse for the customer &#45; but it never twigged with me that this might be the root cause of all my issues.

A normally super helpful command gl&#45;publishitems was the culprit. Gary Lapointes code has helped me out a number of times, this is by no means a slight against his code &#45; just an unforeseen issue arising from it.

Each time the gl&#45;publishitems code was run against the WebApplication it was republishing the &#8220;expired&#8221; content. SharePoint doesn&#8217;t actually use the dates at runtime to decide whether content should be displayed or hidden, it uses the dates as part of the Scheduled Unpublish and Scheduled Publish timer jobs to set the publishing status to published or draft.

The second issue was that not only was gl&#45;publishitems republishing my content, but when the ScheduledUnpublish job would run, it would unpublish the content, however there were previous versions available in the system &#45; and again SharePoint only rolls back the current version not all versions when the Scheduled Unpublish job runs.

So how did I resolve it?

By programmatically getting all versions of the &#8220;expired&#8221; document and setting them to Draft status using the File.Unpublish Command

I&#8217;ve included code samples in both C# and VB.Net here:

VB.Net

if &#40;Convert.ToDateTime&#40;Actual&#41; &amp;lt; DateTime.Now&#41; then   rWeb.AllowUnsafeUpdates = true   lItem.ModerationInformation.Status = SPModerationStatusType.Draft &#39; set the item to draft   lItem.File.UnPublish&#40;&amp;quot;System Unpublished&amp;quot;&#41; &#39;unpublish the file&amp;nbsp;   &#39;for each previous version of the file   Dim objVersionColl As SPListItemVersionCollection = lItem.Versions    If objVersionColl.Count &amp;gt; 1 Then       Previous = &amp;quot;resetting previous versions&amp;quot;      &#39;Navigate to each version of the ListItem       For Each objVersion As SPListItemVersion In objVersionColl          Dim objLstItm As SPListItem = objVersion.ListItem     objLstItm.ModerationInformation.Status = SPModerationStatusType.Draft &#39; set the item to draft    objLstItm.File.UnPublish&#40;&amp;quot;System Unpublished&amp;quot;&#41; &#39;unpublish the file with comment    objLstItm.SystemUpdate&#40;false&#41; &#39;updates the list item without incrementing the version      Next &#39;Next objVersion   End If &#39;End of objVersionColl.Count if   lItem.SystemUpdate&#40;false&#41;end if

C#

if &#40;&#40;Convert.ToDateTime&#40;Actual&#41; &amp;lt; DateTime.Now&#41;&#41; &#123;         rWeb.AllowUnsafeUpdates = true;         lItem.ModerationInformation.Status = SPModerationStatusType.Draft;         // set the item to draft         lItem.File.UnPublish&#40;&amp;quot;System Unpublished&amp;quot;&#41;;         //unpublish the file &amp;nbsp;        //for each previous version of the file         SPListItemVersionCollection objVersionColl = lItem.Versions;         if &#40;objVersionColl.Count &amp;gt; 1&#41; &#123;             Previous = &amp;quot;resetting previous versions&amp;quot;;             //Navigate to each version of the ListItem             foreach &#40;SPListItemVersion objVersion in objVersionColl&#41; &#123;                 SPListItem objLstItm = objVersion.ListItem;                 objLstItm.ModerationInformation.Status = SPModerationStatusType.Draft;                 // set the item to draft                 objLstItm.File.UnPublish&#40;&amp;quot;System Unpublished&amp;quot;&#41;;                 //unpublish the file with comment                 objLstItm.SystemUpdate&#40;false&#41;;                 //updates the list item without incrementing the version             &#125;             //Next objVersion         &#125;         //End of objVersionColl.Count if         lItem.SystemUpdate&#40;false&#41;;     &#125; 

A word of warning

The code I posted here does not differentiate between major and minor versions. You can only UnPublish Major versions so you will need to handle that yourself.

I used SystemUpdate(false) instead of Update as it doesn&#8217;t increment the version count &#45; I would recommend you use File.Update instead.

REMEMBER &#45; ALWAYS TAKE A BACKUP!</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2009-01-29T09:59:59+00:00</dc:date>
    </item>

    <item>
      <title>Voodoo Magic with GDI+</title>
      <link>http://www.brantas.co.uk/blog/voodoo-magic-with-gdi/</link>
      <guid>http://www.brantas.co.uk/blog/voodoo-magic-with-gdi/#When:12:21:44Z</guid>
      <description>Cropping images sounds easy, you get an image, you tell it what size you want it, issue the bitmap.Crop() command and it crops.

No it doesn&#8217;t. It crops and gives you a little freebie&#8230;random lines on your images.

So how do you resolve it? well its as simple as 3 easy steps (wrapped in some GDI+ black magic).

&amp;nbsp;  1. Create your final bitmap at the correct size.
&amp;nbsp;  2. Create your source bitmap from the source image.
&amp;nbsp;  3. Create a temporary rectangle with dimensions 2px bigger than the final one.

Step 1 is nice and simple &#45; create your bitmap as you would want it to appear (say 150px x 150px). Nothing difficult there.
Bitmap bmPhoto = new Bitmap(destWidth, destHeight, PixelFormat.Format24bppRgb);

Step 2 is also nice and easy
System.Drawing.Image imgPhoto = CreateImageFromUrl(sourcePath);

Step 3 Crop your image &#45; heres the science bit&#8230;
grPhoto.DrawImage(imgPhoto,
new Rectangle(&#45;2, &#45;2, destWidth + 2, destHeight + 2),
new Rectangle(sourceX, sourceY, sourceWidth, sourceHeight),
GraphicsUnit.Pixel);

Why does it work? imgPhoto is the image you are using. The first new rectangle is declared as being 1px larger than the imgPhoto in all dimensions and starts 1px to the left and 1px further up than your cropped image, and the second rectangle is the rectangle the same size as your source so that GDI knows how to scale the images.

The code doesn&#8217;t so much as remove them from your crop as leaves them in but makes them outside the bounds of your final image, by doing so, when you do save the image GDI+ ignores them and they aren&#8217;t displayed.

I&#8217;ll try and get a full working example on here for now but that should give you enough information to remove any weird lines you are seeing on your cropped images.</description>
      <dc:subject></dc:subject>
      <dc:date>2009-01-23T12:21:44+00:00</dc:date>
    </item>

    <item>
      <title>Adding Validation to Web Parts</title>
      <link>http://www.brantas.co.uk/blog/adding-validation-to-web-parts/</link>
      <guid>http://www.brantas.co.uk/blog/adding-validation-to-web-parts/#When:10:00:01Z</guid>
      <description>Chances are if you have developed a web part in the past, it needed some user input. And if it needed user input then it needs validation.

When you develop webparts you are unable to do use the designer (thanks Microsoft) so you have to be a real coder and declare, instantiate and add the controls entirely programmatically. Including your validation controls. Ok, you&#8217;ve done that. Why doesn&#8217;t your validation work?

First, you MUST (and I cant stress that enough) instantiate the validators in your overridden OnInit method, not in the CreateChildControls() method. Secondly, set up a validation group so that you can control what the validators are validating (you dont want to validate the whole page) and lastly, you need to ensure that the EnableClientScript property is enabled.



&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.ControlToValidate = this.txtEmail.ID;
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.ValidationExpression = @&#8221;w+([&#45;+.&#8217;]w+)*@w+([&#45;.]w+)*.w+([&#45;.]w+)*&#8221;;
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.ErrorMessage = &#8220;Please Enter a valid email address.&#8221;;
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.Display = ValidatorDisplay.Dynamic;
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.EnableClientScript = true;
&amp;nbsp;  &amp;nbsp;  &amp;nbsp;  &amp;nbsp;  regexpval.ValidationGroup = validationGroup;

&amp;nbsp;

If you&#8217;ve been diligent then your code will compile, deploy and even let you place it on the page, but for some weird reason it still doesn&#8217;t work as you think it should. AAAAARGH!

Its a small and very simple fix, the text box you are validating might be instantiated but it doesn&#8217;t have an ID, D&#8217;oh!

All it takes is adding a line like this BEFORE you set up the validators:

&amp;nbsp;

txtEmail.ID = &#8220;txtEmail&#8221;;</description>
      <dc:subject></dc:subject>
      <dc:date>2009-01-21T10:00:01+00:00</dc:date>
    </item>

    <item>
      <title>Sharepoint Publishing Meta Data Accessors</title>
      <link>http://www.brantas.co.uk/blog/sharepoint-publishing-meta-data-accessors/</link>
      <guid>http://www.brantas.co.uk/blog/sharepoint-publishing-meta-data-accessors/#When:12:19:18Z</guid>
      <description>You&#8217;ve spent the past four days writing the best code in the world to interface with MOSS 2007 and its publishing features. You run it and Argghhhhh! Whats going on, all your publishing data is not there!

Chances are you have done something like this to get the properties:
VB


dim startDate as DateTime = Convert.ToDateTime(item.Properties(&#8220;PublishingStartDate&#8221;));



C#


DateTime startDate = Convert.ToDateTime(item.Properties[&#8220;PublishingStartDate&#8221;]);

&amp;nbsp;

Instead, try accessing the properties like this:
VB


dim startDate as DateTime = Convert.ToDateTime(item(&#8220;PublishingStartDate&#8221;));

&amp;nbsp;

C#


DateTime startDate = Convert.ToDateTime(item[&#8220;PublishingStartDate&#8221;]);

Now get back to that killer code and get it fixed!</description>
      <dc:subject>Sharepoint</dc:subject>
      <dc:date>2008-12-19T12:19:18+00:00</dc:date>
    </item>

    <item>
      <title>UserEdit.aspx displays read only NetworkAccount</title>
      <link>http://www.brantas.co.uk/blog/useredit.aspx-displays-read-only-networkaccount/</link>
      <guid>http://www.brantas.co.uk/blog/useredit.aspx-displays-read-only-networkaccount/#When:12:19:43Z</guid>
      <description>Ok, so you have developed your funky new SharePoint master page and new personal site template. You have set up all the permissions in the SSP to allow users to edit their own profiles and take the headache away from you.

But&#8230;

When a user clicks on Edit on the user display page they only see their network account listed. How do you fix it?

First, its nothing you did wrong with permissions or settings. Its down to the way that WSS and MOSS co&#45;exist on the machine.

The resolution is really simple:

* navigate to the 12templateslayouts hive
* rename the useredit.aspx file to useredit.old.aspx
* copy the editprofile.aspx file and rename the copy to useredit.aspx

Your users will now have a fully functioning profile editing page.</description>
      <dc:subject></dc:subject>
      <dc:date>2008-11-24T12:19:43+00:00</dc:date>
    </item>

    <item>
      <title>CRM Sandpit</title>
      <link>http://www.brantas.co.uk/blog/crm-sandpit/</link>
      <guid>http://www.brantas.co.uk/blog/crm-sandpit/#When:12:18:49Z</guid>
      <description>CRM Sandpit
Microsoft Dynamics CRM provides flexible and familiar business software that allows your organisation to streamline sales, marketing and service based operations. Powerful integration features with other Microsoft Product families enables your organisation to leverage previous investments in Microsoft Technologies.

Dynamics CRM can be used by a wide range of organisations, ranging from small start&#45;up companies wishing to journalise customer activity in a centralised location to large multi&#45;national coprorations seeking to segment different parts of their business processes.

Ok&#8230;so that&#8217;s just sales talk like every other company out there. Don&#8217;t take our word for it, drop us an email using this link and try it for yourself using the CRMSandpit.

What is the CRMSandpit?

In short its a no obligation trial of Microsoft Dynamics CRM. We can set up a user account for you, and you can do anything you want within CRM that you would be if you had installed it for yourself. The only difference is that its already set up and running for you and you don&#8217;t have to deal with the administrative headache of ensuring you have backups and a secured network.

If you decide to go ahead with an implementation of Dynamics CRM we can easily export the customisations and data you entered and import them into your live environment.

So what are you waiting for?</description>
      <dc:subject></dc:subject>
      <dc:date>2008-10-13T12:18:49+00:00</dc:date>
    </item>

    <item>
      <title>Positioning Content at the bottom of a column</title>
      <link>http://www.brantas.co.uk/blog/positioning-content-at-the-bottom-of-a-column/</link>
      <guid>http://www.brantas.co.uk/blog/positioning-content-at-the-bottom-of-a-column/#When:10:00:11Z</guid>
      <description>Say you have two columns, a left and a right column. The left column is to be the navigation are and the right column the content. This is standard for most web sites.

What happens when you want to add a footer to the left column? for example your contact details? sure you could add lots of padding and margins etc but that would break your accessibility. I had a customer that wanted this exact feature in SharePoint 2007 recently.

To be able to have two columns you have to have three divs, the container then the left and right columns.

To maintain accessibility standards and have a screenreader be able to see the navigation, then the content, then the footer you need to do something a bit more sneaky than just pad the navigation.

create your html as below


[code lang=HTML]
&amp;lt;div id=&#8220;Container&#8221;&amp;gt;
&amp;lt;div id=&#8220;LeftNav&#8221;&gt;...&amp;lt;/div&gt;
&amp;lt;div id=&#8220;Content&#8221;&gt;...&amp;lt;/div&gt;
&amp;lt;div id=&#8220;LeftFooter&#8221;&gt;...&amp;lt;/div&gt;
&amp;lt;/div&gt;


Now that you have the html you can style it using CSS.

#Container&#123;   height: auto;   width: 150em;   margin: auto;   clear: both;   position: relative; /* you will see the importance of this shortly*/&#125;#LeftNav&#123;   width: 35em;   float: left;&#125;#Content&#123;   width: 115em;   float: right;&#125;#LeftFooter&#123;   position: absolute;   left: 1em;   bottom: 1em;   width: 13em;&#125;

By setting the position of the container div to relative, you are then able to override any of its child containers using absolute values RELATIVE to the bounds of the container. This means that the left footer will always be at the bottom left (with a 1em margin) of its parent.</description>
      <dc:subject></dc:subject>
      <dc:date>2008-10-07T10:00:11+00:00</dc:date>
    </item>

    <item>
      <title>Serving 404 Errors Correctly in ASP.Net</title>
      <link>http://www.brantas.co.uk/blog/serving-404-errors-correctly-in-asp.net/</link>
      <guid>http://www.brantas.co.uk/blog/serving-404-errors-correctly-in-asp.net/#When:10:00:41Z</guid>
      <description>You&#8217;ve developed a brand new site. It&#8217;s great; there is lots of good content; it&#8217;s standards compliant; And as it&#8217;s in .Net you have used the customErrorPages features of the framework. Brilliant. So why does your error page get indexed when you delete files from the site?

The .Net framework detects that your page is no longer there and so sends an HTTP Status Code 302 to the browser along with a redirect to the error page. The error page is then successfully served within the framework and as such sends an HTTP Status Code 200 to the browser. A user may well be able to read the text on the screen that says their file was not found but the bot crawling the site will think the page is still available as it received an HTTP Status Code 200.

To resolve this you need to do two things:


&amp;nbsp;  Check the page exists &#45; if it doesn&#8217;t server the error page.
&amp;nbsp;  Send the correct error code to the browser.


Check the page exists

In your global.asax you need to check the request is a valid one so within the application_BeginRequest code block add the following:

protected void Application_BeginRequest(object sender, EventArgs e)
{
//get the url
string url = Request.RawUrl;
//check the document exists on the file system
if ((!System.IO.File.Exists(Server.MapPath(url))))
{
//if the document does not exist serve the error page
Server.Transfer(&quot;/Error/FileNotFound.aspx&quot;);
}
}

Send the correct error status

Now that you can tell whether your page exists you can send the correct status, in your error page page_load event simply add:


protected void Page_Load(object sender, EventArgs e)
{
Response.StatusCode = 404;
Response.Status = &quot;404 Not Found&quot;;
}</description>
      <dc:subject></dc:subject>
      <dc:date>2008-09-30T10:00:41+00:00</dc:date>
    </item>

    
    </channel>
</rss>