Archive for the ‘Windows’ Category
While doing SharePoint development, we use a lot of pre- and post-build events in Visual Studio projects to do various things like build and deploy SharePoint solutions to our development environments, activate features automatically and other similar things to make the process of building solutions for SharePoint as automated as possible. One helpful way I’ve [...]
I needed to check which views in a certain database contained a particular string today. This is a pretty easy problem to solve. Just use a query like this: SELECT TABLE_NAME, VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE VIEW_DEFINITION LIKE ‘%<text_to_search_for>%’ This should find any views in the currently selected database that have the text you’re searching for in the [...]
I got an error code 158 today in a FeatureReceiver I had written while trying to delete a MasterPage in the FeatureDeactivated method. I found this helpful blog post explaining the exact problem: http://blogs.msdn.com/ekraus/archive/2008/08/05/cannot-remove-file-error-code-158.aspx In short, the error code means the MasterPage is still in use on the site and so you can’t delete it. [...]
I was struggling to find the source of this error today while working on a SharePoint site. We have a custom page that saves WCF configuration settings for a certain service. It uses an SPPersistedObject to store the WCF configuration form information to populate the form when you visit it later. This method worked fine [...]
I learned something today while trying to add Top Navigation Bar navigation nodes in a SharePoint feature receiver. If you’re adding a node and also wanting to add child nodes of that node at the same time, make sure to actually add the parent node to the TopNavigationBar before trying to add the child nodes [...]
I was getting an error today while working on my company’s custom SharePoint theme on the webpart pages when in edit mode. In IE, you can move the webparts round between the different regions on the page by dragging the webpart headers around. To facilitate this, at some point along the line SharePoint calculates the [...]
I’m not very familiar (which I am actually very happy for!) with VB.NET and so I had a hard time figuring out how to trim newline characters from a string in a Reporting Services report I was working on. Turns out none of the “regular” methods really work. The Trim function only removes spaces and [...]
I was looking for a way to find all the foreign keys to a primary key in a certain table in a certain database today at work. A co-worker of mine found this link: http://sqlserver2000.databases.aspfaq.com/schema-how-do-i-find-all-the-foreign-keys-in-a-database.html It gives a script to use on the database that finds all the primary/foreign key relationships in the database. You [...]

