|
 |
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0  | This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|

October 29th, 2007, 04:46 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Additional page to my store
Hi there,
Was just wondering if any of you could help me. I am trying to create an additional page in my store.
I am trying to add a 'storeCategories' section before i get to departments.
so the store goes: StCategories > Departments > Products
instead of Departments > Products
I have created an extra table called StCategories and i have also create the stored procedures.
how hard is this to do and has anyone actually completed it in their Project?
Regards
John
|

October 29th, 2007, 06:38 PM
|
Authorized User
|
|
Join Date: Jan 2007
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi John,
I havent needed to implement the store but I expect this could be accomplished in the same way most category based databased applications are. One method (as you have already done) is to create an additional table and create a relationship between this an the existing Departments table. If you have already created the Stored Procedures you must already know the data you need from this table so creating the new classes should not be that difficult (you will fine that you could probably copy the existing Departments classes). Another method is to have just one categories table that has an additional field (parentCategory). The advantage of this method is that you can have unlimited levels of categories, and this in my experience normally ends up being the requirement of most e-tailers.
Essentially all you are changing is the way in which you filter the current departments so you should not have to make any changes to the existing products table or classes.
I would suggest checking out the "Customer Support Site" example in Wrox's ASP.net 2.0 Instant Results as this uses the latter method of categorizing db records. You could probably download the app from here if you don't have the book.
|

October 30th, 2007, 05:26 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you very much for you reply.
It is good to know that you are thinking along the same lines as me with this one.
I like the parent category idea as well so i might try it both ways.
I have been struggling trying to re-create the Departments CS to my new Category functions but i should over come this.
once again thanks for your reply, would it be possible to call on you again if i struggle?
Regards
John
|

October 30th, 2007, 06:47 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Just a quick one.
So i am right in thinking that the items i need to edit are the following:-
'SqlStore Provider' (copy all Department info to my Category info)
'Department' (copy this file and amend to categories)
'StoreProvider' (copy all Department info to my Category info)
would you be able to have a look at the resulting files when i have completed them for me :)
regards
John
|

October 30th, 2007, 09:01 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
retroviz,
i have implemented all the extra additions that i need to do this but i cannot get my ShowStCategories page to load with out a exception error.
Would it be possible for me to email you my project for you to have a look at the coding to see if you can spot my error?
The database is already online and all stored procedures are in place as well as the table.
I have decided to create the extra table and just have a relationship with my departments table.
can you please please help?
Kind Regards
John Whiting
|

October 31st, 2007, 04:06 AM
|
Authorized User
|
|
Join Date: Jan 2007
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
John,
May be worth checking your stored procedures for errors first. Can you post the details of the error you are getting?
|

October 31st, 2007, 04:16 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
the error i am receiving is below.
Server Error in '/KM_Web' Application.
The method or operation is not implemented.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Exception: The method or operation is not implemented.
Source Error:
Line 105: private static List<StCategories> GetStCategoriesListFromStCategoriesDetailsList(Lis t<StCategoryDetails> recordset)
Line 106: {
Line 107: throw new Exception("The method or operation is not implemented.");
Line 108: }
Line 109:
Source File: c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\BLL\Store\StCategories.cs Line: 107
Stack Trace:
[Exception: The method or operation is not implemented.]
MB.TheBeerHouse.BLL.Store.StCategories.GetStCatego riesListFromStCategoriesDetailsList(List`1 recordset) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\BLL\Store\StCategories.cs: 107
MB.TheBeerHouse.BLL.Store.StCategories.GetStCatego ries() in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\BLL\Store\StCategories.cs: 99
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(Objec t target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +296
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +29
System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +17
System.Web.UI.WebControls.ObjectDataSourceView.Inv okeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +676
System.Web.UI.WebControls.ObjectDataSourceView.Exe cuteSelect(DataSourceSelectArguments arguments) +2655
System.Web.UI.WebControls.BaseDataList.GetData() +55
System.Web.UI.WebControls.DataList.CreateControlHi erarchy(Boolean useDataSource) +381
System.Web.UI.WebControls.BaseDataList.OnDataBindi ng(EventArgs e) +75
System.Web.UI.WebControls.BaseDataList.DataBind() +86
System.Web.UI.WebControls.BaseDataList.EnsureDataB ound() +82
System.Web.UI.WebControls.BaseDataList.CreateChild Controls() +91
System.Web.UI.Control.EnsureChildControls() +134
System.Web.UI.WebControls.BaseDataList.get_Control s() +27
MB.TheBeerHouse.Helpers.SetInputControlsHighlight( Control container, String className, Boolean onlyTextBoxes) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\Helpers.cs:130
MB.TheBeerHouse.Helpers.SetInputControlsHighlight( Control container, String className, Boolean onlyTextBoxes) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\Helpers.cs:131
MB.TheBeerHouse.Helpers.SetInputControlsHighlight( Control container, String className, Boolean onlyTextBoxes) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\Helpers.cs:131
MB.TheBeerHouse.Helpers.SetInputControlsHighlight( Control container, String className, Boolean onlyTextBoxes) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\Helpers.cs:131
MB.TheBeerHouse.UI.BasePage.OnLoad(EventArgs e) in c:\Documents and Settings\J Whiting\My Documents\Visual Studio 2005\WebSites\KM Alarms Limited\KM_Web\App_Code\BasePage.cs:55
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3034
P.S Thanks for the book advice, i bought it yesterday and it arrived today.
regards
John
|

October 31st, 2007, 09:25 AM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
retroviz,
please ignore the error as i have now managed to apply the additional page - i now just need to tie it all in with my admin section etc.
The only problem i have got now is that i can go from my categories page to my department page and then onto products, however the list of departments from the category page is not listing the relevant departments under that catID - it is only returning the department with an ID of 1.....
can you help?
Regards
John
|

October 31st, 2007, 02:10 PM
|
Authorized User
|
|
Join Date: Jan 2007
Location: , , .
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
John,
I imagine your departments were already created prior to adding the categories table. I would check that each of the department records in your departments table have an associated CategoryID value (or whatever the PK of your category table is).
If all of your departments DO have an associated CategoryID try manually passing the Category ID in your querystring rather than clicking on a hyperlink from your categories page i.e. "ShowDepartments.aspx?CategoryID=2" (or whatever your page is called).
This will then determine whether it is your departments classes/methods failing to retrieve the correct data or just your categories page failing to pass the correct querystring.
Hope that helps
|

October 31st, 2007, 06:39 PM
|
Authorized User
|
|
Join Date: Oct 2007
Location: portsmouth, Hampshire, United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
retroviz,
thanks for yet another reply/answer.
I did mange to do this earlier.
I have set up a test cat & a test cat 2 which 'should' be linked to dept 1 & dept 2. when i click on cat 1 and ID of 1 is passed and when i click on cat 2 an ID of 2 is passed so that is fine.
the departments page just appears to be showing a list of everything in the dapartments table and not by the specific CatID i am passing.
you mentiontioned in your last post that i should look at the Class/method for the departments, where/what in particulr do you think i should have changed with these pages as it appears to me that i obviously havent......:(
regards
John
|
Thread Tools |
Search this Thread |
|
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |