Skip to main content


Showing posts from 2010

Crystal Reports Version History

Crystal Reports has been around for a long time. Some might say too long. Over its 19 year history its certainly become very widespread, and I have nothing bad to say about its presentation. But 19 years of evolution and attempts at backwards compatibility can play havoc with an object model. A case in point: If you want to attach a reports to a different database at run time - a pretty common occurrence - you have to write surprisingly unlikely code . Its easy enough once you know how to do it, but why isn't there any centralised connection information? Crystal Reports has also changed hands a lot over the years, from being owned by Crystal Services, then Seagate, then Crystal Decisions, then Symantec, then Business Objects and finally SAP. This led to a plethora of different version names, and to make things more complicated, the versions that were bundled with Visual Studio were separate releases in themselves. I haven't found any good summaries of the versions and their

Save DataTable to SQL Server

A couple of times now, I've needed to save in-memory ADO.NET DataTables straight to SQL Server as new tables. Its handy sometimes, if you're importing data from other sources. Nick Tompson had posted some code on the social.msdn forum to do this, and here I've stripped out the features I didn't need and adapted it to use StringBuilders: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data; using System.Data.SqlClient; // Save a DataTable to a SQLServer Table // Based on Nick Tompsons code from // // Removed 'make from Schema' options to simplify, and used StringBuilders. public class SqlTableCreator { private SqlConnection _connection; public SqlConnection Connection { get { return _connection; } set { _connection

FlashDevelop, Flex and Balloons

Last year I realised that it was possible to build Flash games using free software - The free IDE FlashDevelop and the free Abobe Flex 3.3 SDK . I finished about 80% of a little flash game, re-using graphics from an old Acorn Archimedes game I wrote about 15 years ago. I was going to add proper menus and music to this, but a year later I still haven't so I guess I'll just abide by the 80/20 rule and post it anyway. Click here to play 'balloonatic' : )

Salesforce as an ORM

To me, Salesforce is not a very attractive word. It basically conjures up an image of an army of salespeople, weilding laptops and software-enhanced selling skills. What could be less appealing than that? But having used their system for a bit, and written code for it, I'm starting to like it. It also helps that they have a charity-foundation wing that sells the software to not-for-profits on a not-for-profit basis. They way the object/database mapping is handled in Salesforce is pretty interesting, compared to, say, a C# program that uses Entity Framework or NHibernate or Linq-to-Sql to talk to a SQL Server. So this blog post is sort of about that. But first, a bit of background: Salesforce is SaaS on a PaaS Salesforce is a ready built Software-as-a-Service CRM, but it runs on their more generic Platform-as-a-Service. This means its very customizable because you can take the Salesforce CRM as a starting point but then pretty much develop anything you want. (Or, y

Quick Elmah setup

Elmah is great. Its an error logging utility that you can drop into a .net app without changing any code . You just drop the DLL in the bin folder, and make a few web.config changes. OK, these days you can achieve the same thing with ASP.NET Health Monitoring , but Elmah is nice and easy, and the web pages it provides to inspect the error log are cool. There are loads of different ways of configuring Elmah (you can get it email errors to you, for example) and the 'demo' that comes with the download shows most of the options. But in most cases you'll want bog-standard logging to a local db, so these notes cover doing that. 1. Download Elmah Download from here. 2. Drop DLLs into Bin folder Unpack the download and look for the appropriate bin folder, usually you'll want the Release version of .NET 2.0 or .NET 3.5. From that bin folder, copy the Elmah.dll and the SQLLite.dll to the Bin folder for your web app. E.g, these two files: ELMAH-1.1-bin\bin\net-2.0\Re

Quick Log4net setup

Log4net has lots of options and different ways it could be configured - these are notes written to myself so that I can get it working quickly. 1. Download log4net Download from here. 2. Drop DLL in Bin folder In the download package, there are various DLLs, usually you'll want the .net 2.0 release version at: incubating-log4net-1.2.10\log4net-1.2.10\bin\net\2.0\release If you have an ASP.NET Web Application Project (as opposed to an ASP.NET Web Site ) then you'll also need to add a reference to the DLL. 3. Add a Configurator line in the Global.asax There are various ways of telling Log4net to pick up its config. We're going to use the Xml Configurator that pulls config from a separate config file. Add this line of code to Application_Start in the Global.asax: void Application_Start(object sender, EventArgs e) { log4net.Config.XmlConfigurator.Configure(); } 4. Add an AppSetting to the web.config The XmlConfigurator.Configure() call above, tells Log