I am new to StoreFront and I have been struggling with the below error for many hours. Does any know the cause of this error? See details below and thanks.

Error Message:

XmlPackage Exception: Exception=Last Trace Point=[]. An error occurred during a call to extension function 'getWarehouseAbbreviation'. See InnerException for a
complete description of the error.

Object reference not set to an instance of an object.

System.ArgumentException: Last Trace Point=[]. An error occurred during a call to extension function 'getWarehouseAbbreviation'. See InnerException for a complete description of the error.

Object reference not set to an instance of an object. at AspDotNetStorefrontCommon.XmlPackage2.TransformStr ing() at AspDotNetStorefrontCommon.AppLogic.RunXmlPackage(X mlPackage2 p, Parser UseParser, Customer
ThisCustomer, Int32 SkinID, Boolean ReplaceTokens, Boolean WriteExceptionMessage)

My code:

The problem function in file QeH2_ItemExtras.cs:

public string getWarehouseAbbreviation(int customerID)
{
string warehouseAbbrev = "Local";

SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["DBConn"]);
SqlCommand proc = new SqlCommand("QeH2_GetWarehouseAbbreviation", con);
proc.CommandType = CommandType.StoredProcedure;
proc.Parameters.Add("@customerID", SqlDbType.Int);
proc.Parameters["@customerID"].Value = customerID;

con.Open();
warehouseAbbrev = proc.ExecuteScalar().ToString();
con.Close();
proc.Dispose();
con.Dispose();
proc = null;
con = null;

return warehouseAbbrev;
}

File page.wishlistcat.xml.config:

<?xml version="1.0" standalone="yes" ?>
<package version="2.1" displayname="Favorites List" debug="false" includeentityhelper="true">

<!-- ################################################## ################################################## ## -->
<!-- Copyright AspDotNetStorefront.com, 1995-2008. All Rights Reserved. -->
<!-- http://www.aspdotnetstorefront.com -->
<!-- For details on this license please visit the product homepage at the URL above. -->
<!-- THE ABOVE NOTICE MUST REMAIN INTACT. -->
<!-- -->
<!-- ################################################## ################################################## ## -->

<query name="ProductCategories" rowElementName="ProductCategory">
<sql>
<![CDATA[
exec [dbo].[QeH2_GetFavoritesCategories] @customerID
]]>
</sql>
<queryparam paramname="@customerID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,9}$" />
</query>

<query name="Products" rowElementName="Product">
<sql>
<![CDATA[
exec [dbo].[QeH2_GetFavorites] @customerID
]]>
</sql>
<queryparam paramname="@customerID" paramtype="system" requestparamname="CustomerID" sqlDataType="int" defvalue="0" validationpattern="^\d{1,9}$" />
</query>


<PackageTransform>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aspdnsf="urn:aspdnsf" xmlns:qeh2I="urn:QeH2_ItemExtras" exclude-result-prefixes="aspdnsf qeh2I">
<xslutput method="html" omit-xml-declaration="yes" />

<xslaram name="EntityName">
<xsl:value-of select="/root/Runtime/EntityName" />
</xslaram>

<xslaram name="pProductCategory">
<xsl:value-of select="/root/Runtime/EntityName" />
</xslaram>

<xsl:template match="/">
<script type="text/javascript" src="skins/Skin_1/jquery-1.3.2.min.js"></script>
<script src="/skins/Skin_1/jquery.watermark.js" type="text/javascript"></script>
<script type="text/javascript" src="skins/Skin_1/wz_tooltip.js"></script>
<xsl:if test ="/root/System/CustomerFirstName != ''">
<script type="text/javascript" language="javascript">
document.getElementById('effDates').style.display = "block";
</script>
</xsl:if>
<script type="text/javascript" language="javascript">
<![CDATA[
function addToShoppingCart(){
return ajaxAddToShoppingCart(document.frmWishlist, document.frmWishlist.CustomerID.value);
}

function showOnHand(variantID, customerID) {
winCompanyOnHand = window.open("/getOnHand.aspx?c=" + customerID + "&v=" + variantID, "CompanyOnHand", "width=500px,height=600px,toolbar=0,scrollbars=1,l ocation=0,statusbar=0,menubar=0,resizable=0,left=0 ,top=0");
}
]]>
</script>


<table border="0" bordercolor="white" cellpadding="0" cellspacing="1" width="100%">
<xsl:for-each select="/root/ProductCategories/ProductCategory">
<tr>
<td colspan="2">
<div style="font-size:16pt; font-weight:bold;">
<xsl:value-of select="ProductCategory"></xsl:value-of>
</div>
</td>
<td colspan="4" align="right">
<span class="cartInfo" style="color:red;font-size:10.5pt;"></span>
</td>
<td align="center">
<img src="/images/BlackYellowCart32.jpg" style="cursorointer; cursor:hand;" name="btnAddCart" id="btnAddCart" onclick="return addToShoppingCart();" value="Add Product Quantities To Your Shopping Cart" onmouseover="Tip('Add product quantities to your shopping cart.')" onmouseout="UnTip();" />
</td>
</tr>
<xsl:call-template name="ProductCategory">
<xsl:with-param name="pProductCategory" select="ProductCategory"></xsl:with-param>
</xsl:call-template>
</xsl:for-each>
<tr>
<td colspan="7" align="right">
<span class="cartInfo" style="color:red;font-size:10.5pt;"></span>
<input type="hidden" name="CustomerID" id="CustomerID" value="{/root/System/CustomerID}" />
</td>
</tr>
</table>
</xsl:template>

<xsl:template name="ProductCategory">
<xslaram name="pProductCategory"></xslaram>
<tr style="height:24px;">
<th style="color:white; background-color:#003562; font-weight:bold; text-align:left">Product Number</th>
<th style="color:white; background-color:#003562; font-weight:bold; text-align:left">Product Description</th>
<th style="color:white; background-color:#003562; font-weight:bold; text-align:center">Price</th>
<th style="color:white; background-color:#003562; font-weight:bold; text-align:center">U/M</th>
<th style="color:white; background-color:#003562; font-weight:bold; text-align:center" valign="bottom" colspan="2" align="center">
On Hand<br/><xsl:value-of select="qeh2I:getWarehouseAbbreviation(/root/System/CustomerID)" disable-output-escaping="yes"></xsl:value-of>&#160;&#160;&#160;Company
</th>
<th style="color:white; background-color:#003562; font-weight:bold; text-align:center">Cart<br/>Qty</th>
</tr>
<xsl:call-template name="Product">
<xsl:with-param name="pProductCategory" select="$pProductCategory"></xsl:with-param>
</xsl:call-template>
</xsl:template>

File page.wishlist.xml.config_store.runtime.xml where default CustomerID is defined:

<root>
<System>
<IsAdminSite>False</IsAdminSite>
<IsAdminSiteInt>0</IsAdminSiteInt>
<CustomerID>58639</CustomerID>
<DefaultVATSetting>1</DefaultVATSetting>
<CustomerVATSetting>2</CustomerVATSetting>
<UseVATSetting>2</UseVATSetting>
<CustomerLevelID>0</CustomerLevelID>
<CustomerLevelName />