The Darkside

Shedding light on things and stuff

 
  Home :: Contact :: Syndication  :: Login
  83 Posts :: 0 Stories :: 57 Comments :: 2 Trackbacks

Ads

 

Donate via PayPal...

...if you feel the site helped.

Archives

Post Categories

Open Source Projects

Other Blogs

SQL

It’s been a while since I used the SqlDependency class and the features it provides, and was then quite disappointed that I hadn’t a copy of the plumbing code anywhere on my web clipboard (a.k.a darkside.co.za). I’ve put together a static helper class that you can attach an event to, and then call the Start(…) method. Here is the code for the class (UPDATE: or you can download it here):     1 using System.Data;     2 using System.Data.SqlClient;     3      4 namespace Darkside     5 {     6     public class SqlNotificationHelper ...


I was busy with a(nother) comparison of Castle ActiveRecord and the Microsoft offerings that have shipped with VS2010 just to make sure that I wasn’t missing out on anything. I ended up fiddling with EDMX files, and then custom generation, which then led me to downloading the ADO.Net POCO T4 generation templates and checking out what was in the files. I have to admit: when I saw what was in it, I got quite giddy with excitement, followed shortly by feeling like a tool. I can’t believe I’ve missed out on this excellent piece of functionality that has been around...


If you get an error message along the lines of “Saving changes is not permitted. The changes you have made…”, it’s actually an option that can be toggled. Go to Tools->Options->Designers->Table and Database Designers and toggle the “Prevent saving changes..” option.


In my previous post I looked at using Castle ActiveRecord and class hierarchies & inheritance to automate some tasks related to implementing audit trails in your application. The foundation was laid to ensure some required information, namely the current user and date and time of editing data, was seamlessly integrated into the domain logic. In this post I'd like to show the next step in this process - that of implementing triggers and the tables required to store this audit trail information.


If you're using a database in any of your unit tests (or dropping/recreating) on a regular basis, you'll inevitably get an error alongs the lines of "Cannot drop database 'Test' because it's in use". Here how to (hopefully) get rid of that problem...


A short script that will return a list of SQL type id's and plain-text names from a MS SQL server.