Posts

MS SQL Explicit conversion from data type ntext to float is not allowed.

When running some conversion in SQL like cast ( dbo . tablename . ntextfield as float ) You get the 'Explicit conversion from data type ntext to float is not allowed' error To resolve this problem use something like cast ( cast ( dbo . tablename . mtextfield as nvarchar ( 10 )) as float )

Missing content editor web part in SharePoint 2010

Quite often I see SharePoint 2010 websites without the Content Editor webpart ( MSContentEditor.dwp ) To enable this web part you need to activate the BasicWebParts feature on that site. I did not find an option to do this by the web site admin; you can enable the feature however by using SharePoint powershell. Execute the following statement in the SharePoint Powershell and the Content editor web part will be added to your site Enable-SPFeature 00bfea71-1c5e-4a24-b310-ba51c3eb7a57 -Url [SharepointSiteUrl]   To get the SharePoint site url just run Get-SPSite

Fishing mail: Openstaande bedrag verkeersvoorschrift!

Het was weer eens zo ver, de zoveelste fishing mail is binnen. Deze kwam toch wel wat serieus op me over en heb deze verder onderzocht. De titel van de mail was Openstaande bedrag verkeersvoorschrift! De tekst begon als volgt   Geachte bestuurder, U hebt een beschikking en vervolgens twee aanmaningen ontvangen voor het overtreden van een verkeersvoorschrift. Het openstaande bedrag is niet (volledig) op de rekening van het Centraal Justitieel Incassobureau (CJIB) bijgeschreven. Daarom zullen wij de bank opdracht geven beslag te leggen op uw rekening per maandag 23 juni 2014. Alleen persoonlijk bij het BKR zelf kunt u inzage krijgen op de informatie die het BKR over u ontvangt. Het beslag leggen op uw rekening betekent dat de toegang tot uw rekening geblokkeerd word met ingang van 23 juni 2014 voor een periode van vier weken. Uiteindelijk komen de betalingen terecht bij een bedrijf met de naam ibeltegoed.nl / Prepaidhub  (een slecht uitziende website die iets doet ...

Zoom Google Map V3 API on all markers with JavaScript

Here a little piece of JavaScript code to zoom in on the Google Maps V3 API on all markers. The data array in the example is a custom Javascript Array with Latitude / Longitude properties. var latlngbounds = new google.maps.LatLngBounds(); for (var i = 0; i < data.length; i++) { var dataPoint = data[i]; latlngbounds.extend(new google.maps.LatLng(dataPoint.Latitude, dataPoint.Longitude)); } map.setCenter(latlngbounds.getCenter()); map.fitBounds(latlngbounds);

SharePoint 2010 distincts between true and TRUE for required field

Today while working with the required field attribute in a list I noticed that SharePoint reacted differently if you write TRUE in upper case. The disitinction is when you try to save a new form and some fields have required="true" instead of required="TRUE" then the lower case variant is not validated on the second postback. So when you first save the form and there are validation errors that are detected server side then on the second postback the required="true" variant is not validated but the required="TRUE" variant is. Strange.

SharePoint Survey Back Button

On Internet I could not find a correct solution for implementing a back button in a survey. After some search I found some near implementations but not an implementation that fully worked. One that inspired me was http://sharepointbender.blogspot.nl/2012/04/creating-back-button-on-sharepoint-2010.html but I found the history.back(-2) not satisfying. I wrote my one version in Javascript that uses the FirstField parameter of the survey to implement a correct behaviour. I hope it makes you happy. In the edit form I added a script link to the code below and i added the following statement spbackButton.init("Name of list"); In an javascript file I included the following code. var spbackButton = (function () { var _prevFieldsArray = new Array(); var _currentStep; var _prevPageStep; function setCookie(c_name,value,exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c...

SharePoint 2013 installation headacks

This blog describes some problems that I faced when installing a SharePoint 2013 server Errors encountered The following error showed up When creating a site collection with a custom solution Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage 'DistributedViewStateCache' - Exception 'System.InvalidOperationException: SPDistributedCachePointerWrapper::InitializeDataCacheFactory - No cache hosts present in the farm. The solution for this problem is to create a new Server AppFabric Cache host and can be found on   msdn . First I created a new SQL database with the name CacheClusterConfigurationDB After that I used the following powershell scripts to create a new Server Appfabric on the server. New-CacheCluster -Provider System.Data.SqlClient -ConnectionString  "Data Source=ServerName\SQL2012;Initial Catalog=CacheClusterConfigurationDB;Integrated Security=True" -Size Small Register-CacheHost -Provider Sys...