Hi, I am creating a data access layer through Visual Studio 2005 (dataset in appcode folder) for my asp.net (vb.net based) application connected with SQL server 2005 db.

I have already created easy tableadapters for brands, categories tables. Right now I am creating Product tableadapter for product table. The product table is inter-related to many other tables like colors, materials, features, photos, articles, measurements, etc.

My question is:

Do I need to create basic Getdata() function configured only for product table with all insert, update & delete queries and then seperate queries like
GetProductsByBrandID(), GetProductsByColorID() like those which involves table joins and sub queries?

or

Do I need to create Getdata() function configured with insert, update & delete queries which includes table joins and sub queries to all inter-related tables?
Anyway I need GetProductsByBrandID(), GetProductsByColorID(), etc. like those queries.


Pls advice.

hi,

i suggest to use

Do I need to create basic Getdata() function configured only for product table with all insert, update & delete queries and then seperate queries like
GetProductsByBrandID(), GetProductsByColorID() like those which involves table joins and sub queries

as for using GetProductsByBrandID(), GetProductsByColorID() we need to send parameters to the specified methods and it would be simple to use.

Thanks for your reply. My requirement is different.
I will ask my question in another way.

As I mentioned earlier, I have Product table linked with many other tables.

1. Do I need to create table adapters only to top level tables like Brands, Categories, & Products or for each and every table in my database which are related to the Product table including reference tables?

2. When I am creating a table adapter for a top level tables, Do I need to create the SQL queries joining all related tables?

I am aware of the usage of parametrized queries for GetProductByBrandID(), GetProductByCategoryID(), etc. For that anyway I have to join other tables.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.