Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2007, 02:43 AM
ADH ADH is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cashed Dataset

I need to frequently extract data from a Dataset and would like it to be cashed.
But in Forum.vb - Dataset is intentionally by design, can not be declared.
So where and how please can I declare it while using the Cashing option?

Thanks
ADH

ADH
 
Old October 8th, 2007, 09:22 AM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

forgive me, but you want to cache a dataset from UI?

If you use TBH, you should implement your own code, but you should too follow theBeerHouse logic (3 layers:DAL->BLL->UI)

So, if you have a dataset on UI, this dataset was sent by BLL, and if you want to cache it you should do it before UI)

If you are talking about forums, you can do:

Code:
'VB code - any class from your bll.Forums
Dim ds As New System.Data.DataSet
' ... (Call your dataset from DAL)
BaseForum.CacheData("key for your dataset", ds)
I hope it helped
 
Old October 8th, 2007, 09:44 AM
ADH ADH is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't want to breach the 3 layer logic,
but TBH is conducting the cash from the Forums (or the Store class), so if I want to cash my Dataset there, I have to import System.data and breach the main logic.
I prefer to that by the DLL so the provider returns the BLL (the class) a list extracted from the dataset, but then I have no access to the cash.
Thanks


ADH
 
Old October 8th, 2007, 09:59 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

ADH - i don't know about vb. but in c# from the UI, you can call the BLL as follows:

string subTitle = BLL.Articles.Category.GetCategoryByID(Int32.Parse( catID)).Title;

or to get a collection of things:

BLL.Forums.Forum forum = BLL.Forums.Forum.GetForumByID(int.Parse(forumID));

not sure if this is what you need or not, but this 100% the way that i access cached data in the UI layer (excepting the aspx markup that references the objectdatasource of course).

jimi

http://www.originaltalent.com
 
Old October 8th, 2007, 03:53 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

jimi, you can call bll from UI.
But you can't run bll.baseforum.cachedata(....) form UI.

Unless you change COM



 
Old October 10th, 2007, 05:14 AM
ADH ADH is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So what about a solution???
How to cash a dataset without breaking the BLL/DAL Syndrom??
ADH
 
Old October 10th, 2007, 10:43 AM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to be more explicit!

From where you want to cache your dataset? From UI or from BLL ?

If it is from BLL the code for that is in my last post to this topic!

 
Old October 10th, 2007, 11:42 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

on a somewhat related idea (in my head anyway!), take a little look at this article which looks at offline merging of persisted data with your database. i've been looking for a good way to do this for quite some time and may look to create a couple of classes that generically handle this. anyway, here's the basic primer:

http://www.madprops.org/cs/blogs/mab...g-Changes.aspx

jimi

http://www.originaltalent.com
 
Old October 10th, 2007, 11:45 AM
ADH ADH is offline
Registered User
 
Join Date: Apr 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

All the Cache is done in the BLL\...Base Classes (BaseForm.vb etc.) on purpose. So If I want to cache a Dataset I've to declare it in a BLL class But this a Data Set and it should be done only in the DAL -where I don't see a caching possibility (I can not "Inherits BizObject"). So no access to the cahe feature from the DAL.
How do I fix it?
(Sorry, but I was sure this was clear from the first place in my previous messages).
Thanks
 
Old October 10th, 2007, 03:13 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ADH, in version 1, we had:

DAL : Fill the dataset
BLL : Retrieve Dataset from DAL
UI : Retrieve dataset from BLL

I think that you have something wrong on your code.
I'll try to explain you:
All the request are made from UI!
Without UI theres no need for BLL and DAL
So try to following this:
If you want to databind some gridview for example you'll make the call to BLL to retrieve some dataset/datatable/List!
ONLY if BLL don't find something cached, BBL will make the CALL to DAL retrieve this from DataBase.
If the dataset that UI want is in cache then BLL don't need to call DAL!
Understand?

So, when you call this Dataset firstTime from DAL to BLL cache it at this time in BLL!

In theBeerHouse you can see this! All the lists are called from Dal to BLL.
You should call your dataset from DAL to BLL to and cache it!

Maybe i don't understand what you really want!
If you want wright here your code... I really think that you are missing some steps!

Good luck!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Fill a DataSet from another DataSet kamranzafar C# 1 February 7th, 2007 11:14 AM
Fill(dataset) or dataset.load() salemkoten SQL Server 2005 1 November 2nd, 2006 11:04 PM
Converting a untyped dataset to a typed dataset daphnean Visual Studio 2005 0 July 13th, 2006 01:16 AM
Copy dataset to another dataset kapila VB.NET 2 November 13th, 2005 06:25 AM
Re: SQL Server dataset to ACCESS dataset dazzer ADO.NET 0 March 22nd, 2004 05:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.