Sytone's Ramblings

The occasional posts of a guy who plays with technology.

Using SqlConnectionStringBuilder in PowerShell

2010-10-12 1 min read General
I wanted to use the SqlConnectionStringBuilder object in the SqlClient area but was having issues accessing the properties. The Object itself is just a collection with a key value structure. To access the keys use the following PowerShell code: $builder = New-Object System.Data.SqlClient.SqlConnectionStringBuilder $builder.Keys To set a property just use the key as a reference. For example: $builder["Data Source"] = $server $builder["Initial Catalog"] = $database $builder["Encrypt"] = $true $builder["TrustServerCertificate"] = $false $builder["User ID"] = $login $builder["Password"] = $password

WPF Converter: CaseConverter

2010-08-29 1 min read Development
Case Converter was made when I wanted the text to display in a WPF UI in upper case. Probably not the best class name, but anyway. To get the code and install read on. Make any UI string uppercase. Once you have registered the resource and created the class just use the converter in the element you want converted. <TextBlock Text="{Binding Title, Converter={StaticResource CaseConverter}}"/> Add the following element to the XAML, usually in Window. Continue reading

Setting Max memory usage in SQL Server

2010-07-30 1 min read Technology
When running SharePoint locally it is a good idea to control the memory usage of SQL. To do this use the SQL query below. [code lang=“sql”] sp_configure ‘max server memory’, 1024 RECONFIGURE GO [/code] A good article that goes through some of the areas you need to look at in relationship to memory is located at: http://www.eraofdata.com/blog/2008/10/sql-server-memory-configuration/

Getting the Central Admin URL for a Farm in SharePoint

2010-07-30 1 min read Technology
I recently needed to get the Url of the CA for a SharePoint farm, after a bit of hunting in the API it was tracked down under the SPAdministrationWebApplication object. C# [code lang=“csharp”] SPAdministrationWebApplication caWebApp = Microsoft.SharePoint.Administration.SPAdministrationWebApplication.Local; var url = caWebApp.Sites[0].Url; [/code] PowerShell [code lang=“ps”] $caWebApp = [Microsoft.SharePoint.Administration.SPAdministrationWebApplication]::Local $caWebApp.Sites[0].Url [/code]

New Toy! Eee PC T101MT

2010-06-22 1 min read General
Photo by ichibodI finally got me one of those new fangled netbooks with touch! I have been looking for a small form tablet PC for a while. So far it has been working as expected, the IO seems a little slow but I am uninstall a heap o apps and will defrag the poor thing shortly. The touch seems ok so far but I cannot wait to get OneNote 2010 on it to see how it rolls. Continue reading

Deleting Content Types in SharePoint

2010-06-22 1 min read General
I found this peice of SQL on the web a while ago, I have no idea where it came from but it did come in handy the other day when a client needed to delete a content type but kept on getting the message it was in use. When deleting content types you need to ensure: All items using the type are deleted (and deleted from the recycle bin) The Content type is removed from any list using it. Continue reading

When is true not true?

2010-05-31 1 min read General
When you look at true stored in the .Net framework. While playing with Pex I found out a interesting fact that the bool is a byte in the MSIL. Which means that a bool could be euqal to anything on the byte range… Now this would require you to go out of your way and create unsafe code blocks to do this. Why you would do this… No ideas :) Its marked as a no-fix which is not supprising as I would not fix it either becase as they say, if you know about this and you use it then you are on your own. Continue reading
Older posts Newer posts