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

Discussion in 'ASP .Net' started by savvy, May 12, 2006.

  1. savvy

    savvy Guest

    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.
     
    savvy, May 12, 2006
    #1
    1. Advertising

  2. savvy

    sloan Guest

    The first thing you're doing wrong is violating

    1st Normal Form

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

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



    "savvy" <> wrote in message
    news:...
    > 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.
    >
     
    sloan, May 12, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. M O J O
    Replies:
    3
    Views:
    377
    Todd Bellamy
    Nov 4, 2003
  2. Phil Carmody
    Replies:
    13
    Views:
    546
    White Wolf
    Sep 12, 2003
  3. bill
    Replies:
    2
    Views:
    439
    P.J. Plauger
    May 25, 2004
  4. padma
    Replies:
    0
    Views:
    374
    padma
    Oct 3, 2007
  5. Replies:
    4
    Views:
    360
    Phrogz
    Nov 2, 2007
Loading...

Share This Page