469,575 Members | 1,658 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

How to retrieve data of a product which falls under two categories??

I'm using MS SQL 2000. I developing a shopping cart where on the admin
side when we are inserting or updating the products, there is a chance
that a single product can fall into two categories therefore i'm giving
the users a option of CheckBoxList control for the categories. The
checkboxlist control is Database Databinded with categories.

When a user selects couple of checkboxes, i'm storing both the
categories seperated with a comma in a single field of database but
then when i want retrieve the all products of a particular category,
this approach wont work. Is their any way around for this??

Even though i use CheckboxList control is their any way to retrieve
products of a particular category?? Can i store each checkbox text in a
different row with the same product ID's in a different table and all
the product info in a different table ?? I hope i made myself clear.

Thanks for your help and time in advance.

May 12 '06 #1
1 1062

The first thing you're doing wrong is violating

1st Normal Form

http://databases.about.com/cs/specif...ucts/g/1nf.htm

I think a better db design is a more appropriate path to getting this
correct.

"savvy" <jo******@gmail.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
I'm using MS SQL 2000. I developing a shopping cart where on the admin
side when we are inserting or updating the products, there is a chance
that a single product can fall into two categories therefore i'm giving
the users a option of CheckBoxList control for the categories. The
checkboxlist control is Database Databinded with categories.

When a user selects couple of checkboxes, i'm storing both the
categories seperated with a comma in a single field of database but
then when i want retrieve the all products of a particular category,
this approach wont work. Is their any way around for this??

Even though i use CheckboxList control is their any way to retrieve
products of a particular category?? Can i store each checkbox text in a
different row with the same product ID's in a different table and all
the product info in a different table ?? I hope i made myself clear.

Thanks for your help and time in advance.

May 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Daniel Tonks | last post: by
8 posts views Thread by Daisy | last post: by
2 posts views Thread by Guoqi Zheng | last post: by
5 posts views Thread by sutphinwb | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.