Category ArchiveDatabases
.NET & Chillisoft & Databases & Microsoft 02 Jun 2009 03:04 pm
Microsoft SQL Server Reporting Services “Object reference not set” error
I had a system deployed to a client site, and everything was working perfectly. The system administrator at the client site did a few things on the server, and next thing the Reports in the web site that use Microsoft SQL Server Reporting Services were giving an error.
Nothing had changed that should have affected the site! So, what could be causing the error?
The error in the report viewer was: “Object reference not set to an instance of an object.”
That’s an all too familiar error to anyone that has programmed in .NET and it is always slightly amusing to find it in someone else’s released program. The other day I got one from SQL Server Administrator when I clicked on something in the tree view on the left (just after I had freshly installed Reporting Services). Aha, so they are not infallible! A slight grin etched itself across my face. Well, anyway, the solution was a tried and tested standard Windows solution… Restart the PC. Amazing how often that works with Microsoft stuff hey! But in my case I was getting the error in my application, in a section that I had no control over, so how could I save myself this embarrassment?
Continue Reading »
C# & Databases 04 Mar 2009 01:05 pm
MySQL DATE_FORMAT results in System.Byte[]
This problem comes up in certain circumstances where you use DATE_FORMAT in your sql query and use the output in your C# code. The problem is that a byte array is returned and a ToString on that value will result in “System.Byte[]“.
Continue Reading »
Databases & Habanero 20 Feb 2009 06:14 pm
Hell is testing without an in-memory database
Application maintenance tends to be a cumulative experience. Each new bug report, however inconsequential, comes attached with increasing levels of resentment from the development. You fix, you create patch, you launch live, you accidentally break something else, you get phone call. Customer unhappy, developer burnt out. Developer changes jobs, application is passed around like a hot potato, and the next developer is even more likely to break things than the first, given their lack of knowledge of the application’s “unique problem solving strategies”.
Continue Reading »
Databases 21 Jan 2009 10:35 am
MySQL: Create Column If It Doesn’t Exist
The scenario is simple: create one sql statement that creates a column only if it doesn’t exist. I’ve done a fair amount of research on how to pull this off in MySQL, but it seems the verdict is out that it can’t be done in one swoop. SQL Server seems to support it, but I was certainly blanking out in MySQL.
Continue Reading »
Databases 21 Nov 2008 03:05 pm
MySql ERROR 1005:Can’t create table (errno: 150)::InnoDB
My task was to integrate two Database structures.When I tried to create a foreign key reference between one of the existing tables and a new table Mysql Administrator gave me the following error:
ERROR 1005: Can’t create table (errno: 150) :: InnoDB
I have found this sql error message to be rather cryptic.
Continue Reading »
Databases 11 Nov 2008 12:25 pm
Listing the Foreign Keys in a Firebird Database
We have just completed the code to reverse engineer a Firebird database and build the class definitions used by the Habanero framework. It wasn’t a simple effort and in fact took us some 4 or 5 hours, more than other vendors like Sql Server and MySQL. Understanding the metadata/information schema structure for Firebird was reasonably straightforward for table names, field names and primary keys, but foreign keys was a little more subtle, and there was not much help available through Google search.
Continue Reading »
Databases 10 Oct 2008 09:39 am
SQL Query Analyzer: See More Than 255 Characters
If you are needing to see more than 255 characters for any particular field in the display grid of Query Analyzer once you have run a sql query, the option to extend the length is found in Tools > Options > Results > “Maximum characters per column”.
Databases & Habanero 03 Jan 2008 10:08 am
Mixed Inheritance Types in One Heirarchy
In a previous post on the Chillisoft Blog, we discussed different implementations when you attempt to store an object-orientated inheritance structure in a relational database. Catering for these different implementations is one challenge, but a new frontier dawns when you try and mix multiple implementations in a single heirarchy.
Continue Reading »
Databases 03 Jan 2008 09:47 am
Inheritance Structures in ORM
In the quest to map an object-oriented structure into a relational database, one area with a plethora of implementations is inheritance. For a moment I will attempt to categorise the possibilities here, but in truth, new possibilities could be emerging all the time. For now, however, let’s look at several common implementations.
Continue Reading »
Databases & Habanero 06 Dec 2007 04:58 pm
Switching Databases at Runtime
One of the particular challenges of working with object relational mapping (ORM) tools is that you often begin with a given database schema. This presents an uphill battle as you now hunt for an ORM framework that matches the methodology used in the database design. As developers in large organisations know, waging war with a DB administrator is a game of politics … a losing game. Especially with Oracle DBA’s.
Continue Reading »
Databases & Habanero 06 Dec 2007 04:24 pm
SQLite Gets an ORM Boost
Habanero has just boosted its database vendor support list with the addition of SQLite, the popular and nifty open-source database.
Continue Reading »
Databases 10 Aug 2007 04:30 am
A Visio to MySQL adventure
My two hour desert walkabout to convert a Visio ERD into a MySQL database was illuminating. To save you travel time should you want to walk the same journey, here are a few pointers:
First, establish an ODBC connection. Download and install the MySQL ODBC driver from here.
Continue Reading »
