Monday, February 27, 2006
I think I just wasted somewhere around 10 hours over the last several days trying to track down an issue I've been having.  It started out as what should have been a painless project upgrade from VS 2003 to 2005.  This particular project happens to use Crystal Reports XI. 

"Well, that's your first problem!"

Yes, I know.  Crystal.  A fool to be pitied, am I.  Alas, it's a customer requirement... on with the story.

Everything compiles and runs great.  However, now none of the reports are working.  I'm getting all kinds of weird exceptions.  I fight with references and what-not for a couple of hours.  Turns out, for .NET 2.0 you need to download Crystal Reports XI Release 2.  No problem.  It's only a 1GB download.  That should only take, what, three days?

Fast forward download and 2 hour upgrade install.  Everything compiles and runs great.  However, now none of the reports that have parameters are working.  I'm getting a weird exception whining that ParameterDiscreteValue can't be cast to ParameterValue, even though ParameterDiscreteValue inherits from ParameterValue.  Only makes sense, right?

I run through and fix all my references again, and then start narrowing down and eliminating all the possible culprits.  I double-check my code against all samples and Google results I can find.  No dice.  So, I give up and open a support case with Crystal.  Insert typical support response: "Have you tried running the samples?"

At this point I'm so desparate that I actually do run a sample project that sets parameters dynamically.  It works.  So, I set out to plug one of my own reports into the sample project.  It works.  WHAT?!

After stepping through every line of code for the millionth time (give or take 3 builds), I finally go back and check my references again.  Hmm... that's odd.  All my Crystal references are OK except the Crystal Engine is pointing to the 10.0 version that ships with VS 2005.  Update the reference and recompile.  Run a report.  Exception.  Check my references again.  Hmm... that's odd.  The old reference is back again.

OK... the fix??  After setting the reference, I have to set the "Specific Version" property to "True."  If I don't, VS 2005 is kind enough to automagically change my reference back to the previous version.

This is actually not the first time this issue has happened to me.  At this point I'm so frustrated I could spit.

Hey, wait. These spots on my laptop might be dried spittle.  I'm not sure.

Monday, February 27, 2006 11:27:11 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  | 
Annoucement link.  "Free to develop, deploy, and distribute" and suited (among other things) for "developers working on PHP, Java, .NET, and Open Source applications."

According to the FAQ, the Express Edition has the following limitations:
  • Limited to 4GB of user data
  • Only one instance per server
  • Only executes on one processor if running on a multi-processor server
  • Will only utilize 1GB of memory, even if the server has more
Oracle 10g Express Edition comes with a "browser management interface" which I assume is better than Microsoft's MSDE command-line OSQL.

My company is considering Oracle as an alternative product platform, so I'm sure I'll be giving this a try sooner or later.

Monday, February 27, 2006 10:28:28 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Sunday, February 26, 2006
Scott Guthrie points out the new "How Do I?" series of videos on MSDN.  According to Scott, these are 10-15 minute "pure code" walkthroughs using some of the new ASP.NET 2.0 features and the free Visual Web Developer.  There are currently 11 videos available, and Scott says that more are on the way.

Sunday, February 26, 2006 4:40:29 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Wednesday, February 22, 2006
In case someone else would like to know how to create a singleton DataManager class for WilsonORMapper that uses IsolatedContext and works in ASP.NET...

View DataManager.cs

using System.Configuration;
using System.IO;
using System.Reflection;
using System.Web;
using Wilson.ORMapper;

namespace Portal.Data
{
    /// <summary>
    /// The DataManager class is the singleton instance of the ObjectSpace class
    /// </summary>
    public sealed class DataManager
    {
        private const string MAPPING_FILE = "Mapping.config";
        private static readonly Guid CONTEXT_KEY = Guid.NewGuid();
        
        /// <summary>The application connection string read from app.config</summary>        
        /// <example>
        /// Add the following key to the "appSettings" section of your config:
        /// <code><![CDATA[
        ///     <configuration>
        ///            <appSettings>
        ///                <add key="IMI.Portal.Framework.Data.ConnectionString" value="Data Source=(local);Initial Catalog=DATABASE;User ID=USERNAME;Password=PASSWORD;" />
        ///            </appSettings>
        ///     </configuration>
        /// ]]></code>
        /// </example>
        public static readonly string ConnectionString = ConfigurationSettings.AppSettings["ConnectionString"];
        public static readonly string CurrentProvider = ConfigurationSettings.AppSettings["Provider"];

        /// <summary>The singletion instance of an ObjectSpace Class</summary>
        private static ObjectSpace objectSpace; // = GetDefaultInstance();
        private static object syncLock = new object();

        private DataManager()
        { }

        #region public static ObjectSpace ObjectSpace

        /// <summary>The singleton method for retrieving the global ObjectSpace</summary>
        public static ObjectSpace ObjectSpace
        {
            get
            {
                if (objectSpace == null)
                {
                    lock (syncLock)
                    {
                        if (objectSpace == null)
                        {
                            objectSpace = GetDefaultInstance();
                        }
                    }
                }
                
                HttpContext context = HttpContext.Current;
                if (context != null)
                {
                    ObjectSpace isolatedContext = (ObjectSpace) context.Items[CONTEXT_KEY];
                    if (isolatedContext == null)
                    {
                        // Cache the isolated context in the current request so that it is used
                        // throughout the entire request

                        isolatedContext = objectSpace.IsolatedContext;
                        context.Items[CONTEXT_KEY] = isolatedContext;
                    }
                    return isolatedContext;
                }
                else
                {
                    return objectSpace;
                }
            }
        }

        #endregion

        #region private static ObjectSpace GetDefaultInstance()

        private static ObjectSpace GetDefaultInstance()
        {
            Assembly assembly = Assembly.GetAssembly(typeof(DataManager));
            
            using (Stream mappingStream = assembly.GetManifestResourceStream(
                typeof(DataManager),
                MAPPING_FILE))
            {

                switch(CurrentProvider)
                {
                    case "MySQL":

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            GetMySQLProvider(),
                            20, 5);

                    case "PostgreSQL":

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            GetPostgreSQLProvider(),
                            20, 5);

                    // TODO: Oracle?

                    default:

                        return new ObjectSpace(
                            mappingStream,
                            ConnectionString,
                            Provider.MsSql,
                            20, 5);

                }
                
            }
        }

        #endregion

        #region private static CustomProvider GetMySQLProvider()

        private static CustomProvider GetMySQLProvider()
        {
            //Provider provider;
            CustomProvider provider;
            provider=new CustomProvider("MySql.Data", "MySql.Data.MySqlClient.MySqlConnection", "MySql.Data.MySqlClient.MySqlDataAdapter");
            provider.StartDelimiter="";
            provider.EndDelimiter="";
            provider.LineTerminator=";";
            provider.IdentityQuery= "SELECT LAST_INSERT_ID()";
            provider.SelectPageQuery="SELECT * LIMIT {0} OFFSET {1}";
            provider.ParameterPrefix = "?";
            provider.GuidDelimiter = "'";

            return provider;
            
        }

        #endregion

        #region private static CustomProvider GetPostgreSQLProvider()

        private static CustomProvider GetPostgreSQLProvider()
        {
            // Npgsql, the .NET provider for PostgreSQL can be found here:
            // http://pgfoundry.org/projects/npgsql

            CustomProvider provider;
            provider=new CustomProvider("Npgsql", "Npgsql.NpgsqlConnection", "Npgsql.NpgsqlDataAdapter");
            provider.StartDelimiter="[";
            provider.EndDelimiter="]";
            provider.LineTerminator=";";
            provider.IdentityQuery= "SELECT currval('{1}_{0}_seq')";
            provider.SelectPageQuery="SELECT * LIMIT {0} OFFSET {1}";
            provider.ParameterPrefix = ":";
            //not sure about this
            provider.GuidDelimiter = "'";

            return provider;
            
        }

        #endregion
    }
}
       
Wednesday, February 22, 2006 8:43:01 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Saturday, February 18, 2006
Version 0.9.2 of MySQLSchemaProvider for CodeSmith and MySQL 5.0 is now available for download.  Changes include:
  • Updated GetTableKeys() to provide not only the foreign keys for the table but also the foreign keys of other tables that point to the given table. Code update graciously provided by Dug Steen.  Thanks!
  • Added .NET 2.0 version for CodeSmith 3.2.5 or higher
  • .NET 1.1 version requires CodeSmith 3.1.6
Keep in mind that the version requirements are for the assemblies that ship with the current download.  If you are using a previous 3.xx version of CodeSmith, you can simply recompile from the source code and it should work.

Saturday, February 18, 2006 12:38:57 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  | 
 Thursday, February 16, 2006
Read the announcement here.

Thursday, February 16, 2006 1:16:10 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Tuesday, February 14, 2006
Yahoo! has released a free library of AJAX-enabled UI components, including a set of core utilities for animation, drag-and-drop, events, DOM, as well as calendar, slider, and treeview controls.  The components are both free and open-source under a BSD license.

Also noteworthy is the new Yahoo! Design Pattern Library.  Here they attempt to demonstrate UI best practices for the Web including breadcrumbs, pagination, and other common UI elements.  This is their first installment of what they promise to be a monthly installment of the latest Web patterns and practices.

Tuesday, February 14, 2006 12:24:25 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
For you geeks out there.  Today is Valentine's Day.  Yes, slap yourself in the forehead.  These are no substitutes for REAL cards and flowers, but maybe you can appease your spouse or loved one with one of these e-cards while you scramble to the nearest store on your lunch break and fight all the other procrastinators over the last clump of wilted weeds meant to pass as flowers.

Family Life E-Cards

CrossCards

123Greetings Valentine's Cards

Tuesday, February 14, 2006 7:31:08 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Friday, February 10, 2006
Great news for ASP.NET developers.  After joining Microsoft, Matt Hawley had to stop distributing his great ASP.NET server controls.  After 10 long months, he's finally been given permission to start distributing them again.  My company and I have used his pop-up calendar control.  I also use Unleash It (unaffected by the blackout) to deploy web applications, and it is fantastic.  Thank you Matt, and thanks for listening, Microsoft!

Friday, February 10, 2006 4:16:07 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 
 Monday, February 06, 2006
Here are a few links you might find useful:

Godbit Project - "Theology + Technology"

If Jesus Had a Website - "Helping Church Websites Improve Their Digital Home"

So You Want a Church Website? - "Resources for the Accidental Church Webmaster"

Mobile Ministry Magazine - "Using technology and the scripture to equip men and women to minister the Gospel to the nations."

SonSpring - One of the authors for Godbit Project.  "SonSpring is a small, Christian web design and graphics studio that specializes in creating sites for churches and non-profit organizations. The mission statement and fervent prayer is that the utmost would be done to glorify the Lord Jesus Christ through use of website development."
Monday, February 06, 2006 1:42:36 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |