previously, i had added an "itemCode" column to the db and got it to work in the site by copy/paste/edit the code for the "description" column in sqlcatalogprovider.vb, item.vb and category.vb and adding the Eval... code to item.aspx and itemdetail.aspx.
because the 400 images i have for the items are all different sizes/proportions, i can't use the method that comes with the starter kit to just display them at fixed sizes, so i've added larger images for the items and that's what i want to display on the itemdetail.aspx page. i've used the same process as before, just going through the site where i had added the itemCode code and added in code for the imgLrgUrl column. but it ain't werkink.
i get the error below about the GridViewItems.DataBind() in items.aspx.vb. if i comment back out all the imgLrgUrl related code, it works fine, i just get the small images same as is shown on the items page.
Any help would be greatly appreciated.
Section of items.aspx.vb where it stops:
' now display the correct panel (categories or items)Dim currCategories As List(Of Category) = Catalog.GetChildCategories(categoryId)
If currCategories.Count = 0 Then
PanelItems.Visible =
True
PanelCategories.Visible =
False
GridViewItems.DataBind()
Else
PanelItems.Visible =
False
PanelCategories.Visible =
True
GridViewCategories.DataBind()
End If
Error it throws:
System.Reflection.TargetInvocationException was unhandled by user code
Message="Exception has been thrown by the target of an invocation."
Source="mscorlib"
StackTrace:
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at System.Web.UI.WebControls.GridView.DataBind() at ItemsPage.Page_Load() in C:\Websites\smlbzqsk\Items.aspx.vb:line 75 at System.Web.Util.CalliHelper.ArglessFunctionCaller(IntPtr fp, Object o) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException: System.IndexOutOfRangeException
Message="imgLrgUrl"
Source="System.Data"
StackTrace:
at System.Data.ProviderBase.FieldNameLookup.GetOrdinal(String fieldName) at System.Data.SqlClient.SqlDataReader.GetOrdinal(String name) at System.Data.SqlClient.SqlDataReader.get_Item(String name) at SqlCatalogProvider.GetChildItems(String parentCategoryId) in C:\Websites\smlbzqsk\App_Code\Catalog\SqlCatalogProvider.vb:line 60 at Catalog.GetChildItems(String categoryId) in C:\Websites\smlbzqsk\App_Code\Catalog\Catalog.vb:line 34
InnerException: