|
-
Nov 3rd, 2003, 02:05 AM
#1
Thread Starter
Junior Member
Accessing Dataset Cells in multi-tier apps
i'm currently working on a three-tier windows application. i'm having a problem regarding proper coding. please read the example below:
Example, I have three classes:
1. UI.ItemsForm (contains a dataset object named dsItems)
2. Business.Items (connects UI.ItemsForm to Data.ItemsDAL)
3. Data.ItemsDAL
The UI.ItemsForm fills the value of dsItems using a method in Business.Items. On the other hand, Business.Items gets data using another method in Data.ItemsDAL. Once UI.ItemsForm.dsItems is filled-up, the only way I can access the cell values is to write code like:
Console.WriteLine(dsItems.Tables(0).Rows(0).Items("ItemCode")
Ideally, UI.ItemsForm should not have any knowledge about the structure of the database. Thus, it should not be aware that the column "ItemCode" exists (the text "ItemCode" should not be hardcoded.
So I'm wondering, what would be the proper way to implement a correct three-tier application that uses a dataset? Any advice? I was thinking of creating constant variables in the Data.ItemsDAL, then access it in the UI.ItemsForm throught the Business tier. But I don't know how.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|