Archive for the ‘Programming’ Category


Better Tools For SQL Server Compact

Saturday January 16th 2010

I’ve been doing quite a lot of Windows Mobile development lately coupled with SQL Server Compact 3.5 and the thing that struck me pretty quickly was how shabby the actual Microsoft tools for the job are.


Whilst you can open an SDF database in Management Studio, you can’t edit the data, or script it or do anything useful really. Using Visual Studio is a little better, as you can at least edit the data, but annoyingly despite telling VS to remember the database password, it never does.


One of the most infuriating things that I came across recently is the fact that you can’t change the order or the names of the columns once you have created them. So if you get something wrong, you have to delete the column and add it again. Shabby.


So after a bit of searching around I came across a whole range of tools devoted to working with SQL Compact databases. Most of them do a fair job, but the best one by far in my opinion is ExportSqlCe.


ExportSqlCe is an add-in for Management Studio 2008, which allows you to script out the schema and data from an SDF as well as viewing and editing the tables. Put simply this is what Management Studio should have been able to do from the off. The best bit about it is that it’s free and open source.


So if you work with SDF files, head over to CodePlex and grab yourself a copy.


http://exportsqlce.codeplex.com/

C# from VB.NET – Some helpers

Thursday December 31st 2009

Following on from the post about iPhone development using MonoTouch and C#, I thought I would point out the fact that at the moment MonoTouch doesn’t support Visual Basic for iPhone development. Mono and MonoDevelop themselves do support VB, but just not for iPhone dev just yet. The MonoTouch team say it is on the roadmap, just no date as of yet.

 

So where does that leave the Visual Basic developer? Well, if they want to write iPhone apps using the .NET framework, then needing to learn some C#.

 

For many VB developers, who came to .NET from VB6 (and below), stepping up to a fully object orientated language and the .NET framework was tough enough to grasp, let alone taking on dealing with curly braces as well. Whilst VB.NET is not the same language as VB6, Microsoft did a pretty good job at smoothing the upgrade path for developers (certainly with VS2005 and .NET 2.0 upwards anyway).

 

Many developers will probably have some exposure to other languages, such as PHP, JavaScript, or even Java (remember that?), all of which would make learning C# a bit easier, but if you haven’t then don’t worry too much. If you know the .NET framework, then you’re already halfway there.

 

(more…)

iPhone Development with C# and .NET

Wednesday December 30th 2009

iPhone development using MonoTouch

Well, it’s been a year to the day when I decided to crack on with some iPhone development, and what a year it’s been. Busy is certainly one word that would sum it up. Having plenty of work, especially at a time when many are suffering the effects of a tough financial climate, is something always to be grateful of, but sometimes it can hamper other goals.

 

So how far did I get with Objective-C and iPhone development? Well, I did get some done, and I am certainly a mile up on where I was a year ago, but I haven’t got anything quite completed. It’s been a learning curve for sure, but a good one.

 

I’ve got my Apple Developer account setup, under my new business name of side lane studios, and have plenty of app ideas lined up and ready to take shape, the first of which I was planning on completing in January. It’s about 50% complete at the moment, so I was going to give myself a window to knuckle down with it and submit it to Apple for inclusion in the App Store. Then I came across MonoTouch and everything changed.

 

(more…)

Obfuscation and LINQ

Friday August 21st 2009

On a .NET project I’m working on at the moment I stumbled across a problem yesterday when I started using LINQ to SQL as the ORM. It threw me at first, but once I realised what was going on it was simple to fix, but something to be aware of none the less.

 

The problem basically comes from obfuscating the assembly, in particular the LINQ classes generated by the LINQ Designer, which when you think about it makes perfect sense. If you obfuscate the table names in the LINQ generated class, how is the code going to know what table to connect to on the SQL database?

 

The simple solution is to exclude the LINQ generated classes from obfuscation. For me I use the excellent {smartassembly} so this is pretty easy, by just checking it in the {sa} interface. Alternatively you could use the custom attribute <DoNotObfuscate()> _ at the top of the class to tell {sa} to ignore it.

 

DANGER: UXC (Unexploded Code)!!!!!

Wednesday January 14th 2009

Sloppy code. We’ve all seen it, and the problems it can cause. Whether that is not thinking things through fully (ie: no impact assesment), simply being careless and slapdash when it comes to writing code (ie: don’t care or in a rush to get it out), or even the programmer being as thick as two short planks (ie: should be digging holes for a living), the results can be pretty much the same.

 

I know one ‘programmer’ who doesn’t even compile code after writing it. They just hack it together, check it back in, and sit back with their feet up scoffing pies. Of course more often than not it wouldn’t actually compile, and it needed somebody else to fix their fix. Thus wasting everybody’s time.

 

(more…)