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]  | 
 Friday, January 27, 2006
ComponentArt announced yesterday their new beta Web.UI 2006 suite.  Included are two new controls: WebChart Lite for ASP.NET and Splitter for ASP.NET.  I had a chance to install the beta today and play around with the demos.  Once again, ComponentArt have outdone themselves.

WebChart Lite has all the features and API of its WebChart for ASP.NET big brother, but only supports 2-D charts.  Actually, from what I've seen, WebChart Lite will generate 3-D charts, but they are rendered with ComponentArt watermark.  I think it is outstanding that ComponentArt chose to provide WebChart Lite to its Web.UI subscription customers.  I'll also add that the licensing for the full version is quite reasonable when compared to some of the other charting components on the market.

The new Splitter control is very impressive.  With it you can create resizable panels that can be split horizontally and vertically, and can also collapse and expand.  The Splitter "panes" can have minimum and maximum heights and widths, or can fill the entire window area.  Layouts can be changed dynamically.  The demos provided look like an RSS reader or e-mail client.  There aren't any online demos yet, but if you download the beta you can view the demos locally.  I can think of quite a few areas in my own applications where I'll be using this new control.

Web.UI 2006 will also include ASP.NET 2.0 versions of their controls with support for new features such as skins, themes, and the ASP.NET 2.0 navigation architecture.  Way to go, ComponentArt!

Friday, January 27, 2006 6:48:49 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |