Determining the NameSpace for an ECT in SharePoint WP

June 4, 2014 2 comments

So the other day, while working on a SharePoint project, I started writing a custom workflow in Visual Studio and I needed to access an ECT programmatically. To date in this project all my WebParts had the usual custom properties to define the NameSpace for the ECT that I needed to access. But suddenly I was in a situation where that information was not available.

So I had to try and find it a different way. After sitting in a debugging session for a bit and interrogating objects and properties, I eventually found it. So in the interest of sharing some code, here it is. Now I couldn’t find a solution online after googling & binging for a bit. And there might be other solutions out there much better than mine.

using (new SPServiceContextScope(SPServiceContext.GetContext(SPContext.Current.Site)))
 var service = Microsoft.SharePoint.Administration.SPFarm.Local.Services.GetValue<BdcService>(String.Empty);
 Microsoft.BusinessData.MetadataModel.IMetadataCatalog catalog = service.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);

 var tmp = catalog.GetEntities(“Agencies”);
 var _NameSpace = tmp[0].Key;

Now the “Agencies” entity is just an ECT that I know will be there and it is purely used to be able to extract the NameSpace. And there you have it, no more custom properties on my WebParts to configure the NameSpaces for the ECTs.

If you want to run with the big dogs, don’t piss like a puppy…

April 9, 2014 2 comments

So, a very explicit title, but very true in what I am feeling like tonight.

Several years ago I was my geeky self “dating” a beautiful girl my age. And although I cannot remember the context, but that is what she said one night to me. And for some or maybe obvious reason it has stuck with me for many years.

So what is this al about. Well, its a rant about people these days… I might have mentioned previously how the world has changed and so has people. I still remember the days where, as a developer, you were giving, if lucky, a database diagram, a rough indication of what was needed and then you had to get on with it. But then also got swamped with 20 other issues and you either swam or sank.

These days it seems that unless you spoon feed someone nothing gets done. And then at the slight bit of pressure people crack up completely. What have we become. Maybe we need and end of world experience like all these apocalypse type movies or Zombie movies for people to grow some.

Work is not supposed to be easy, that’s why you get paid to do it. You are supposed to face big challenges everyday and you need to cope. True that sometimes you are actually completely overloaded, but in most cases that happens fairly infrequently.

Most companies, I think, at a certain size become far to lax and just let things slip. I’ve had far to many meetings today where that was the case. And then you sit there and think that how can we actually progress without some pressure. Yes, the business has to support you, and they usually do. But when things get a little hard for a short period, people just seem to throw in the towel.

But the nature of private sector is pressure and doing more with less. That’s how you get ahead of your competition. But without your staff understanding that and wanting to assist it doesn’t work. I truly blame technology and the ease of access for this. I love my tech, but because everything is instant and available, people employ that far to much in their daily lives. And they believe they are worth much more than what they are, and companies buy into that.

I will never forget working on a 386 when Pentiums were out for more than 2 years. Having to deliver on big projects. But I had to make it work and get things done. Late nights and so much overtime without compensation, but that’s how things were. Developers these days can’t event set up their own machines, let alone testing environments…

So why the rant, well, an email set this off… And I think it was pathetic from that person.. Shame, but maybe I’m being to harsh… NOT!!!

Categories: General

How to make a Developers life’s easier…

February 26, 2014 Leave a comment

So the catch is in the title. I suppose the easiest way is to put them in a multi-coloured room, with gaming consoles, unlimited coffee and unlimited pizza… But that’s just a pipe dream for most of us. But what I have found over the past year or so is ways to make me more productive and make my life much easier. The problem is that I can now develop from wherever I am, on whatever I want.

In saying that, I’m going to mention a few things I use and play with that I found has made my life much easier & less dependant on others, as well as give me the ability to be creative wherever & whenever I want.

Mind you, most of what I will be mentioning focuses around Windows development, but some of this can also be used for other development.

Source Control

Now I know about GitHUB etc, but Microsoft has fairly recently released Visual Studio Online ( and this services provides you with all the functionality you’ll need in Team Foundation Services. The great thing is that it’s a hosted service that integrates nicely into Visual Studio. But this can also be used for other environments. And it supports Git as well. What’s also great is that you can manage a full SCRUM environment within this, with a great UI that’s easy and intuitive. So that’s my source control out of the way.

Development Environments

Most of my development these days are done from my Acer Icona W700. And yes, its possible. Because we have a Azure account ( and I have my own MSDN subscription, I have the option of spawning virtual development environments that has all the tools I need to be productive. And the great thing is I can even connect to it from my phone and develop, albeit a little tricky to type loads of code, but nevertheless. Most of these environments are set up for you and you might need to make a few minor tweaks and install some other components, but they work great. And because my source control is already online, I just hook into it and off I go.

Project Siena

So Microsoft is busy beta testing this, and what it really is, is a Windows 8 app that allows you to create Windows 8 applications easily on a touch enabled device. Now I must admit it has a few interesting quirks to it, but WOW, how easy are they making it for us. Granted, you cannot do the most advanced things in it, but I can almost guarantee that they will allow source code / solution downloads soon. So then you can very easily start the project with most of its artefacts from your tablet in a coffee shop and download and continue else where.

App Studio

Now this is my favourite at the moment ( This little service allows you to easily create and even publish Windows Phone Apps to the market place with hardly any code involved. What’s great is that you can download the full solution file and tweak where you need to. I have already created and published a small app this way and have another three in the making. Fairly trivial apps, but the first one was done in less than an hour.

Project Monaco

This is another one of those really great productivity tools, but also enables you to work from anywhere with any device. Project Monaco allows you to edit websites on Azure through a browser. with all the intellisense etc that you would need to be productive with. Coupled with the fact that the3 website is hooked into Visual Studio Online for your source control.

There are tons of other things & ways to improve a developers life out there, but these ones have made such a big difference in my life. I can now be creative whenever, wherever & on whatever device I want to. Go have a look at these and let me know what you think…

Until next time :)

Categories: General

Belated Welcome to 2014

January 20, 2014 Leave a comment


Better late than never.. I suppose. So the year has started with a bang, or shall I say carried on instead. I didn’t really have a break as I needed to save my leave for our trip to Capetown in March. But its all good as I was very productive over the festive season. It’s the best time of the year to get through some back log.

So another year, more exciting challenges in life and work. Something to look forward to. Nothing better than conquering them one at a time.

Looking forward to some new technology coming to our shores this year, and obviously the Xbox One!!! Also looking forward to a role change at work which has been in the making for almost 2 years now. So this is definitely something I am looking forward to. The ability to focus a little better.

Now I don’t believe in new years resolutions, but I will have a goal to be more active on my blog and get some more exposure. But I need better content for that and follow through on some of my posts. I also want to get a few HowTo’s out this year as there has been so many things I have struggled with and had to spend hours and sometimes days finding solutions. And most of those are definitely worth sharing.

So, some goals this year…

- Finish my Windows 8 App

- Finish some Windows Phone Apps

- Blog more

- Enjoy life a bit more

So until my next post. Have a great 2014 and make it count. It wont be there again in 2015… :)

Categories: General

Back to stability… :)

August 18, 2013 Leave a comment

So a while ago I posted about Windows 8.1 Preview. One thing I mentioned was that my Bluetooth stopped working and that I ended up buying a dongle so I can use the keyboard and mouse. This weekend I actually just had enough. There were so many little things that stopped working or was just not very optimised. And I can understand that it is/was a preview…
Yesterday I managed to rebuild my tablet back to Windows 8 and I have spent countless hours trying to get all my apps back on and get my tablet to a production state again.
The Windows 8.1 was a good experience and I am looking forward to so many new features, but my tablet was too unstable to be productive. So this is the first time I have ever backed out of a preview program… Sorry Microsoft, but the experience on a tablet was just not good. Maybe next time.
According to the news on the interwebs, a mid October release has been announced. Will wait for that then and enjoy the features. Chat soon.
Categories: General

LeapMotion inbound…

July 24, 2013 1 comment

So this post might seem a bit late, and maybe it is if you have been following the social media wave. But I was just thinking about it again today whilst still waiting for mine. And after I saw a tweet from someone returning his already.

What I’m talking about is this really small and excitingly interesting little gadget called the LeapMotion. The LeapMotion is basically an input device for your computer. And that means it allows you to interact with your computer in a new and exciting way. Up until today you were able to use a keyboard for typing, mouse for interacting, Track balls, touch pads, gamepads, Kinect and some of you might still remember the big fad with VR (Virtual Reality) some time ago. Now the LeapMotion is just such a device. But it creates a 3D space around it and using your hands in mid air, you interact with your computer.

As soon as I got wind of this great new toy I had to place an order and I still remember rushing to the site and making sure I get my details in as quickly as possible. And Monday was the official, delayed, launch day. although I saw loads of tweets about people already receiving their pre-orders over the weekend.

So here I am, anxiously awaiting the delivery of my LeapMotion so I can have some fun with it. This has definitely been one of my most anticipated devices in years and I know it wont disappoint. Once I have my grubby little fingers on it I’ll post some more stuff around it.

Categories: General Tags: ,

Windows 8.1 Preview…

June 29, 2013 2 comments

While I was going through my twitter timeline on Thursday night I suddenly remember that Windows 8.1 Preview is supposed to be available any day now. Quick check on the Microsoft website and I found the link. And off course, I had to install it. And in true Henry style, I skimmed over any text and tried to find the download link, and click… Well, maybe I should not have clicked to eagerly…

A fast 14mb download and a few updates later and I was redirected to the new Marketplace. Looked good and in front of me was Windows 8.1 Preview, with some weird squiggles where the install button should be. Not really worried I clicked it and some time later my Acer Icona rebooted and I had to again choose a few settings. And there it was… Windows 8.1 Preview.

At first glance, nothing really special, except the glaringly obvious start button. Seriously, who missed that. Not me. Already used to not having it and really just taking up space now.

First of all, some irritations so far from using it for a few days.

1. Swiping is not as precise and smooth as before. And this makes my tablet feel very clunky and slow.

2. After every reboot I get an error dialog on my desktop. Something about BVTSTACK. Seems to be related to the Acer software and after checking could find anything.

3. Even though it picks up the built in Bluetooth chip, I cannot pair any devices or even see them. So I’ve resorted to buying a very small USB Bluetooth device

4. A few of my not so important is crashes for no reason

Now I fully understand this is a preview. And I was a bit silly not to create a rollback “disc”, but I did expect all hardware devices to still function correctly, as this is a smallish upgrade to Windows 8.

Some likes

1. On the main start screen, swiping up now lists all the installed apps. That’s a nice and quick way to get to them and I love it

2. Music app is more user friendly and seems to perform a little better

3. Quick and seem less install. Did not have to completely rebuild the tablet

4. Enjoying the additional options for changing the tile sizes and also customising the home screen is now the same as my Windows Phone 8 and I love the consistency

Subsequent to this “upgrade”, I have also downloaded the Visual Studio 2013 Preview and will also be playing with that over the next week or so. I’m glad I did the preview install and will start getting used to the changes and will be anxiously await updates to this. Next week I’ll post some more details about Windows 8.1 Preview and also how living solely with the tablet is shaping up.

Chat soon. :) 

Categories: General

Get every new post delivered to your Inbox.

Join 299 other followers