Tuesday, September 29, 2009

SQL Server Express and Reporting Services

A common question that gets asked is if SQL Serve Express supports Reporting Services. Yes it does however you need to install the version Advanced Services which can be downloaded from here.


In addition to the usual restrictions you get with the Express version you can only use Reporting Services against you local express database i.e. you cannot install SQL Express and then use it’s Reporting Service against a database on another server.

Wednesday, September 23, 2009

XRM - What is it?

Just in case you stumbled across the term XRM and was wondering what is this new buzzword. It is the new brand name for developing applications using Microsoft Dynamics CRM. I believe Microsoft have coined this term because customers can be confused when you tell them you are going to build their line of business application using CRM. By the way I think CRM it is a great platform which gets very little recognition especially in comparison to SharePoint.

CRM in built on a .NET application development platform which can easily be extended by developers using the same SDK as the Microsoft CRM development team. Some people have suggested that CRM was only developed to show the power of the development platform.

Going forward I don’t XRM will mention CRM and with the multi tenant support added in version 4.0 I think it will become an important piece in Microsoft cloud development platform. Stay tuned.

Monday, September 14, 2009

30th Sept - Windows 7 Technical Community Launch Cork

The community launch of Windows 7 takes place on Sept 30th at 2pm in the Rochestown Park Hotel. Each lucky attendee will get a copy of Windows 7 Ultimate and you can register for attendence here event

Places are limited however if you are i t he MTUG user group you will have received a promotion code that will give you priority.

In the evening there will be a separate event focussing on Windows 7 and home server with demo with XBox and Microsoft Live which will be worth a look register here event

Monday, September 07, 2009

Auto update columns in Dynamic Data

Lots of people have a requirement to have some columns automatically updated when using Dynamic Data in conjunction with the Entity Framework. These are typically audit type columns such as the ModifiedDate column found in the AdventureWorks database.

The typical solution is to create a handler to trap the event so that you can change the data before it is saved to the database.


public partial class AdventureWorksEntities : global::System.Data.Objects.ObjectContext
    {
        partial void OnContextCreated()
        {
            this.SavingChanges += new EventHandler(OnSavingChanges);
 
        }
        private static void OnSavingChanges(object sender, EventArgs e)
        {
            foreach (ObjectStateEntry entry in ((ObjectContext)sender).ObjectStateManager.GetObjectStateEntries(
                 EntityState.Added | EntityState.Modified))
            {
                int i = entry.CurrentValues.GetOrdinal("ModifiedDate");
                entry.CurrentValues.SetValue(i, DateTime.Now);
            }

This can give you problems if you want a generic version for all tables but not all the tables have the ModifiedDate column and so GetOrdinal throws an exception. An alternative is to use some reflection to check if the Property exists and update accordingly and avoids exceptions being thrown.

foreach (ObjectStateEntry entry in ((ObjectContext)sender).ObjectStateManager.GetObjectStateEntries(
                EntityState.Added | EntityState.Modified))
            {
                // Ignore relationships
                if (!entry.IsRelationship)
                {
                    foreach (PropertyInfo pi in entry.Entity.GetType().GetProperties())
                    {
                        if (pi.Name == "ModifiedDate")
                            pi.SetValue(entry.Entity, DateTime.Now, null);
                    }
                }
            }