Archive for February, 2006

Indexed by google :-)

February 19, 2006

Did a search today and found I’m indexed by google! It took about 4-5 days to come through but now the blog is finally out in the wild ūüôā

Welcome…

February 18, 2006

Althought this is not my first post (code is more important anyway ;-)) I thought I may as well introduce my blog, me,¬†and its purpose…

I wasn’t really big into starting a blog myself (because I already spend too long online anyway) but I do enjoy getting tips from other peoples technical blogs.¬†I’m also constantly playing with stuff 24/7 so I thought I may as well share some of the knowledge I get along the way – Put something back into the community so to speak. I’m one of those people that forgets what they have been up to (information overload)¬†and have been looking for someway to collate what I’ve actually found out. This¬†got me to make the jump to¬†chucking it¬†up here as I thought I may as well put it¬†somewhere others can get a bit of a look in and share a few ideas –¬†Basically I’m going to use the blog as a scratch pad for anything¬†technical I’m up to (if I get time) – big or small.

I graduated at the end of 2004 / start of 2005 with a Telecommunication degree and have been working for a New Zealand based company called Intergen (the Wellington Branch). Intergen works purely in the MS space touching on all the technologies out there as quickly as possible – a lot of which I have already got to play with even only being a very juniour developer – very cool indeed. Last year I put a heap of effort into all sorts of coding bits and pieces (learnt a lot – and even discovered a few unique things at the time) but I never put it anywhere – basically lost it… This year armed with a bit better understanding of what is actually cool I decided I may as well put it out there for you guys to have a look at too.

Some of the stuff I’ve played with so far, and could give some help on,¬†has been:

VS2005 (since late 2004),¬†SQL2005 (mid 2005 – a lot of work in the Integration Services space – did a lot of stuff with custom components very early on), BizTalkServer2004 (early 2005 – limited knowlege here but found the quirks etc with BTS :-)), MS Vista (Installed this the day it came out :-)), WinFX – mainly WFP (Avalon) – general playing early on although I’m going to do some more of this with the CTP of the Expression Designer out now and the release finally stable, Continous Integration with CruiseControl.Net, VSTS, and over the last few months NHibernate and code generation via SqlSMO etc.

There’s lots and lots but those are the ones I can think of at the moment… Bascially, when it comes out – I do some, check what it does well, find the quirks, do something funky and then if I like it and can use it stash it away somewhere. I love hearing key words from people because I then go away and suss it out – do some examples etc.¬†This is the info I’m hoping to share on this blog. As a side note this can be a good site to keep an eye on in terms of MS movements(http://channel9.msdn.com/) ¬†Outside of the work workspace I love hardware design (DSP’s, microcontrollers, interfacing with devices, FPGA’s etc) so I also get right into assembler, C++, Handel-C, Matlab, Network comms, wireless, Linux, opensource components¬†etc. With all the stuff from MS coming out recently it’s been put on the side line for a while but at some stage I’ll do some and post up what I’m working on ūüôā

Some of the current work I’m looking into both in and out of work¬†is: Best Practises with the extended features of SQL2005, SQL2005 Mobile – Writing PDA applications, NHibernate – stub solution generation, mapping generation etc – this will be an up and coming post – Trying to get some better design patterns under my belt (currently working on a MVP (http://www.martinfowler.com/eaaDev/ModelViewPresenter.html)¬†implementation over NHibernate with a custom generation layer) and just becoming a better coder – better with the BCL, better code design etc – I’m only early in the piece but its one of those things where I like to know what I’m doing and keep up with the play¬†ūüôā

Thanks for coming for a visit – and if your into a bit of coding why not pop back sometime ūüôā

VS2005 Automated Dataset Generation

February 18, 2006

Something that¬†bugged me¬†yesterday at work was the¬†pain involved when the database is changed and¬†a projects¬†datasets need to be updated (something constantly happening during an apps early dev cycle when the database is still under tweaking). In our case the datasets¬†are effectivelly a¬†straight mirror¬†of the information in the database (simply drag on the tables and away you go – no internal customization) so I was like “man – there has to be a better way – surely this can be automated and¬†how does the designer do it?”. So I went on an investigation…After a late night coding session it was done ūüôā

Firstly, as always, I googled a bit and then generated some datasets (checking out all the project options/the files generated etc) and watched what was going on with good old regmon, filemon, and pmon as a way of reverse engineering and seeing what was going on when you were using the ide. After digging a bit I came across MSDataSetGenerator and xsd.exe. MSDataSetGenerator from what I can gather is a com component which handles the dataset components inside the ide (when you check the default tool on the properties of the dataset it is listed there) РI tried for a while to find where the dll was located but had no luck so I then decided to try something else РI could see that xsd.exe would generate the file which is commonly called datasetname.Designer.cs (dataset class file) from the dataset xsd so all I now needed was the xsd file. The xsc and xss just dealt with the layout properties so I figured they were just ide overhead and I could work those out later.

Firstly I wanted to avoid calling out to xsd.exe and I worked out that you could use: TypedDataSetGenerator.Generate() from the System.Data namespace to get similar functionality i.e. it would generate a dataset class file from an xsd. However, near the end of my journey I found that this generated un-compilable dataset class files from the xsd РIt would ignore some of the options specified against the dataset name (msprop:Generator_TablePropName) so if your dataset had the same name as a table it would have name conflicts with properties exposed on the dataset. xsd.exe on the same xml picked these options up perfectly (and generated an identical match with what the ide would generate) РI had a winner Рcall out to xsd.exe with the dataset xsd (this seemed to be the fastest option to get something to work).

To get the dataset xsd I reverse engineered the xml that would be generated in the xsd if you dragged on a few tables, set up some relationships etc i.e. Where did the elements need to go? How where they named? What were the options if they were nullable? What could be stripped out? etc. I then rolled¬†the generation all¬†up into a class which I could then call and just tell it “these are the tables in my dataset – make it!”¬†The datasets where being autogenerated!¬†ūüôā¬† As for the xsc and xss files I wrote these out as if no tables had been dragged on. The good thing about this is that when you drag them on the display settings get saved into the xsc file – so you need to go and move all the tables to get them looking pretty. By leaving them as the default, visual studio would do a pretty arrangement (like the sql management studio option)! Something I havent seen available even from in the ide – killed another problem – didnt need to lay them out now either = even less work ūüėÄ

So what are the cons – I havent implemented the mapping of all the sql types to xml types yet (just the most obvious ones) – this wont be hard at all since most of the types produce the same xml – it is more a case of just checking for the special cases and putting those in. Something I’ll do as they come up. xsd.exe needs to be called – maybe this is not too ugly…The code had been slapped together (but it seems to work – some file stuff access needs to be looked at + refactoring) ūüôā – I’ll fix it up during intergration. The dataset specification file is just a comma delimited text file (something to be¬†upgraded to xml¬†during intergration into the main generation tool – if the guys like¬†the tool¬†:-P).

The pro’s are – no more dragging, 1 click to update all datasets to a new database schema, no more arranging, we dont use the data adapters (we delete them) so those are left off (if someone wants those I could put them back in), is quicker than the ide – no lagging out :-). You just need to keep the generation file up to date (we already have one for the main tool which will have all of this info so no probs there)

I’ll post up the first cut of code but if someone wants a hand or has some questions then post them up – Hopefully you wont curse at your db designer when they do an update now ūüėČ Note: You will need to setup the app config with the right options for your machine (xsd.exe is under C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\xsd.exe if you have installed vs to your c drive) – The app also needs to be compiled ūüôā Big ups to JD for chucking this on his server for me! Thanks bro!

http://blog.bluecog.co.nz/uploads/DataSetGeneration_00.zip

Upgrading VSTS Beta 3 to RC and Cruise Control

February 16, 2006

Well I was going to do a little introductory post¬†for my first ever post but I figured I may as well put something usefull out there and then do an intro later (if I get time that is….).

Last night I upgraded our install of MS Team Foundation Server from the Beta 3 to the RC, making sure to follow all the instructions carefully. This went really smoothly and everyone seems to be back underway this morning (whew). The only things I came across where:

1) There are two KB packages mentioned in the install doc – these are found on the RC disk if you are wondering where they are.

2) Read http://blogs.msdn.com/vstsue/articles/500334.aspx as stated in the install doc РOne thing it mentions is the backup of the encryption key for the reporting services database. I didnt see this anywhere else so if it goes bad it might pay to do this as well.

3) Read Jonesie’s blog as well (http://jonesie.net.nz/TFSRCUpgradeFun.aspx¬†given to me by /\ndrew at http://andrewpeters.wordpress.com/). He mentions hitting the registaration service. I’m not sure if this was fixed with the patched installer but I did it anyway and the upgrade worked so why not a ūüôā Also, the re-install of the team explorer client is another thing to note.

4) Make sure you also do the install under a domain account – not just logged in as the admin on the box. I think with the beta 3 it told you to but you could get away with it … can’t remember now but that’s something to watch out for – If you forget then just login and restart the install ūüėČ

Apart from that it all just seemed to work. The cool things I did find out though were:

1) You can delete TFS projects using TFSDeleteProject.exe found under C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ . We found that people wanted to play with the first install of the TFS box but once the root node was in there we couldnt really get rid of it (didnt know how to completelly delete it). I’m not sure if we just didnt spot¬†a gui option from vs¬†but this little guy works when run from the server or a client machine ūüôā¬†The annoying thing is that if¬†the creation of the project fails the root node can end up in there¬†but then the delete won’t seem to work! Arrhhh – I’m not sure if you can try the creation again with the same name or if it just kind of gets stuck …. something I’ll have to look into

2) If you are using cruise control with the vsts plugin (http://vstsplugins.sourceforge.net/) then this will need to be recompiled. Grab the source and do a rebuild – it will fall over but (as a dirty hack to get our box running again) I commented out the line:

teamFoundationServer = TeamFoundationServerFactory.GetServer(this.Server, this.Credentials);

that it fails on and replaced it with the line:

teamFoundationServer = TeamFoundationServerFactory.GetServer(this.Server);

I spent like less than 5 minutes on it but I patched the dlls up onto the server and cruisecontrol is up and running again (copied all the ccnet ones and the vsts plugin dll as well). This is probibly not the best but I just wanted to get it working again – Hopefully someone might find it usefull until the actual vsts plugin dll gets recompiled on the official download site ūüôā (I’ll try and¬†post the dll’s up soon¬†if someone just wants to download them – Hopefully it will work just as well for you as it did for me – Just having some upload issues at the mo)