bryan 0

bryan 0

  • NA
  • 9
  • 0

8 related tables, how do i create relationships in VS.2003

May 26 2005 1:16 AM
The below is suppose to display: home_name, person_id, person_name, person_age, person_job field records with no problem. However when i re-create da1 to input tb3 to tb8 and select the company_name field to show on the datagrid as well, it doesnt display any records. The relationships are created in the MS access already and when i used data adapter query builder, the relationships are there as well, am i missing any steps? 1. How do i get the dataview to display only columns: home_name, person_id, person_name, person_age, person_job 2. How do i ensure rowfilter is able to search for records in tb4 and tb8 such as tax_amount(tb6), company_name(tb4) and realestate_name(tb8) 3. I think my major problem is i'm not sure how to create master/child relationships. - My Codes: Private Sub frmResults_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'da1 is a data adapter that has 2 tables: tb1 & tb2 'i used vs.net to drag the oledbdataadapter to select fields using sql query builder 'the datagrid will show eg: home_name, person_id, person_name, person_age, person_job da1.Fill(ds) dataview = ds.Tables("tb1").DefaultView 'dg is datagrid with dataview as DataSource dg.Datasource = dataview dataview.RowFilter = "person_name LIKE 'john'" Table: Fields ------------ tb1: home_id, home_name, home_type tb2: person_id, home_id, person_name, person_age, person_job tb3: company_id, person_id tb4: company_id, company name tb5: tax_id, person_id tb6: tax_id, tax_amount tb7: realestate_id, home_id tb8: realestate_id, realestate_name the above are all inter-linked, i'm not sure how do approach this? should i use each data adapter for one table and link all data adapter to dataset? i tried all methods but i can't get my dataview to display any values. note: tb3 to tb8 maybe empty sometimes. How should i do or code this? - any advise will be appreciated!