Wednesday, May 26, 2010

"Specified cast is not valid" when converting to variable from SqlDataReader

"Specified cast is not valid." exception thrown from converting data from a SqlDataReader, i.e. short shortVar = (short)reader["shortField"];

If your types are actually the same, then this error implies that you must use a Convert.To method.

short shortVar = (short)reader["shortField"];
short shortVar = Convert.ToInt16(reader["shortField"]);

How to add resources to subprojects in Project Server 2010

If you have a master project with many subprojects then the answer is crappy. You must add the resources to each subproject individually. Unfortunately the resources do not appear to trickle down from the master project.

Friday, May 21, 2010

SharePoint People Picker Returns No Results

In SharePoint Server 2010 in Central Admin you try to look up a user, but it returns no results.


1. Open up SharePoint Management Shell
2. Run these two commands
  • stsadm -o setapppassword -password password 
  • stsadm -o setproperty -pn peoplepicker-searchadforests -pv ",username,password" -url http://centraladminurl


Jonny Trees Online: SharePoint People Picker Returns No Results