Thursday 31 July 2008

It's all a bit of a hassle...

My continuing struggle to get as close to the pro version of Visual Studio.net using only the Express Editions and legitimate downloads... Well... It continues....

I've just managed to get SQL Server Express working pretty well with support for SQL Server Compact and Reporting Services.

You need to get hold of SQL Server 2005 Express Edition with advanced services from here. Install that with all options selected to be installed. Once you've got that in, then you can download and install Microsoft SQL Server 2005 Express Edition Toolkit. Again just install the whole thing. Once that's done you can download Microsoft SQL Server Management Studio Express Service Pack 2. Get that one installed and then fire up the Management Studio and you'll be able to connect to the local SQL Server instance and also any SQL Server Compact Database! You can also fire up the Reporting Services Configuration Tool and get those working. To create reports you need to click on the Business Intelligence Development Studio. If you get an error saying that it can't find devenv.exe then you need to extract all files from SQLEXPR_TOOLKIT.EXE using something like WinZip, find the file called vs_setup.msi and run it. This will install the necessary Visual Studio 2005 files needed for this to run. And Hey Presto... It Works!

The question is... Why... Well basically to see if I could do it. Also as nice as SQL Server Express is, I would have to pay for it on my hosting package at an exorbitant price. So I want to use multiple SQLCE databases for free.

My quest continues...

Monday 14 July 2008

It's finally working

After a week or so of shouting, screaming and hair pulling I've finally managed to get my prototype app to connect to the new NeSS Data Exchange beta program using C# 2008 Express Edition.

It's been a huge pain in the arse because it uses SOAP and security token extensions that aren't supported natively in the Express editions. To make it work properly I had to download and install Microsoft's Web Services Enhancements 3.0. Once installed I had to use the configuration tool to create a wse3policyCache.config file to use a Username token with my application.

Once configured the following code worked a treat:

//Set up Credentials
const String UserName = "username";
const String PassWord = "password";

//Create new token
UsernameToken tkn = new UsernameToken(UserName, PassWord, PasswordOption.SendPlainText);

//Set up containers and service
NeSSDiscoveryService service = new NeSSDiscoveryService();
SubjectTreeRequest theRequest = new SubjectTreeRequest();

//Add token to service
service.RequestSoapContext.Security.Tokens.Add(tkn);

//Perform the query
SubjectTreeResponse theResponse = service.GetSubjectTree(theRequest);

//Get Array length
int responseLength = theResponse.SubjectTree.Length;

//Create Subject Branch Array
SubjectBranch[] theBranches = theResponse.SubjectTree;

//Introduce program
Console.WriteLine("This Program Will test the NeSS Web Services");

//Iterate through results
for (int i = 0; i < responseLength; i++)
{
Console.WriteLine(theBranches[i].Subject.Name);
}

Console.WriteLine();
Console.WriteLine("===========================================");
Console.WriteLine("End of output. You can close this window");
Console.WriteLine("===========================================");

System.Threading.Thread.Sleep(50000);

And hey presto the Subject List is outputted. Now to put that in to practice with a proper app. :)

Wednesday 9 July 2008

It's unimaginable.

No techie blag on this one despite the amount of web service blah I've been doing recently.

I've just had one of the scariest moments of my life. My daughter was up stairs watching High School Musical 2 and all of a sudden I heard a huge crash and then she screamed. I've heard her cry before, but this was real screaming. I bolted upstairs and found her hanging upside down by her leg on the ladders at the end of her cabin bed. There really is no way to describe the feeling that hit me in the stomach. I ran over and picked her up and carried her downstairs really not knowing what to do despite all my training in first aid and dealing with injuries. I immediately began checking her legs for signs of breaks and was on the brink of calling for an ambulance. It seemed like there was no way she couldn't have broken her leg given the weird angle her leg was in when I found her and the fact she was hanging upside down by it.

After much frantic checking I'm pretty convinced that it is whole. She managed to stand on it fine and ran back up the stairs after a little while. She's going to have one hell of a bruise though.

It really badly shook me up though, based on when I broke my leg and had to spend three months not being able to put weight on it and then another three months of physio. That really got me down and I was 23. I really couldn't imagine what an impact that would have had on the life of a five year old.

Anyways, thankfully she's okay. I now need to drink a lot of wine and smoke many cigarettes to try and calm down.

Wednesday 2 July 2008

It's a new month so here's a new post.

I have been over-indulging a lot of late. Not only did Firefox 3 come out, but also OpenSuSE 11! In general it's very cool, although I did have a couple of problems with the compiz-fusion desktop, so I just got rid of it for now. I'll give it a try again later when it's had a bit more time. Likewise KDE 4.

I've been spending a lot of time with .NET recently too. I'm developing a prototype application to store an evidence base for the whole county. It's pretty cool so far, although I did run in to some weird problems with maintaining the state of checkboxes within a gridview control. No matter what I tried, it just wouldn't remember the states. After much investigation I discovered that it was maintaining the state, but something else was unchecking the boxes in a later event. So instead of setting the value of the checkboxes in the onpageindexchanging event I put it in the ondatabound event and hey presto! it worked fine.

It's looking increasingly more likely that I'm going to be staying in the job over the course of my degree too. That would be absolutely awesome and beats the hell out of a part time job in a pub! :)