none
Dataset VB 2008 Question RRS feed

  • Question

  • I am running into an issue where I have two tables that are connected through a relationship.  Here is an example of the fields and data:

     

    Table A                                                 

    CategoryID

     

    Table B

    CategoryID

    SubCategoryID

     

    Table A

    Hardware

     

    Table B

    Hardware, Hammers

    Hardware, Nails

    Hardware, Lumber

    Walls, Lumber

     

    When I created the relationship in VB.Net I used the CategoryID for join the tables, but when the program runs it gets an error when loading Table B's table in the dataset.  It seems to me that the lumber subcategory is causing the issue, but I am not sure how to resolve it.  Any help is appreciated.

     

    Wade73

     

                                             

    Thursday, May 1, 2008 12:52 PM

All replies

  •  Wade73 wrote:

    I am running into an issue where I have two tables that are connected through a relationship.  Here is an example of the fields and data:

     

    Table A                                                 

    CategoryID

     

    Table B

    CategoryID

    SubCategoryID

     

    Table A

    Hardware

     

    Table B

    Hardware, Hammers

    Hardware, Nails

    Hardware, Lumber

    Walls, Lumber

     

    When I created the relationship in VB.Net I used the CategoryID for join the tables, but when the program runs it gets an error when loading Table B's table in the dataset.  It seems to me that the lumber subcategory is causing the issue, but I am not sure how to resolve it.  Any help is appreciated.

     

    Wade73

     

                                             

    Monday, June 30, 2008 6:54 AM
  • i want to get value of data row of one field. like in vb6   adodc.recordset.field ("Password")

    please reply soon...

     

    Monday, June 30, 2008 6:59 AM
  • In your case it looks like you are missing entry in Table A for Walls. In this case there is a child in Table B (Walls, Lumber), but there is no related parent CategorylD in Table A.

     

    Tuesday, July 1, 2008 2:33 AM
    Moderator
  • Actually, there was an entry for walls, but I left it off.  What I was trying to show was that I have two categories with the same subcategory.  I would think creating a relationship based on the category id would not cause an issue, but it does.

     

    Wade

    Tuesday, July 1, 2008 8:10 AM
  • What is exact error message you get?

     

    Tuesday, July 1, 2008 10:42 AM
    Moderator