Results 1 to 8 of 8

Thread: database query problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    database query problem

    Hello all,
    I had two table in MS access Database 1. radioboxes, 2. boatinfo and i link them together through radioboxes.productionno and boatinfo.F1... now when i press on the preview data i am seeing the data and when i press on + sign i see the data in the second table... i had assigned the binding in the properties window for all the information i need and i only get the information from the first table while i can't display the information from the second database

    I hope i explain my problem, and thanks for your help in advance.

    BR,
    Quince

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: database query problem

    I'm afraid you haven't explained your problem. Are you saying that you want to be able to see related child records in your app the way you do in Access? If so then you cannot do so with the standard grid controls. The DataGridView doesn't support it at all and the DataGrid has limited support, in that you can see the child records but not at the same time. You have three choices:

    1. Use two grids: one for parent data and one for related child data.
    2. Make use of the DataGrid's limited support for navigation of relations, which means accepting the other shortcomings of that control.
    3. Use a third-party grid control.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    Re: database query problem

    thanks for your reply,
    but i am not using data grid
    if you can see the image i attach you will see two section the parent section will be the first one and it has it's own table and the second one it has a separate table...

    now i need when i select a record in the first section to show me if there is any records in the second table and display it in the section 2 ...

    i hope i cleared it now... now i am only getting the first section but i can't display any information for the second one...

    br,
    quince
    Attached Images Attached Images  

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    Re: database query problem

    isn't there anyone could help me in here ???

  5. #5
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: database query problem

    I assume you have a FK relation?
    You have to bind the every item-textbox of section2 with the FK of the bindingSource between the to tables and then bind your textboxes displaymember to the row you wanna view.

  6. #6
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: database query problem

    So what initiates the seach of the second table for data? How are the two tables linked?
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2007
    Posts
    15

    Re: database query problem

    i have created a data adapter where i link both tables from there... and when i preview the data i can see that i have one table with all the data i need but i can't display it ...

  8. #8
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: database query problem

    The solution is.
    Create a dataset with your data and relationships.
    Use the bindingsource to bind the textboxes in your 1st session.
    Use the bindingsource FK relation to bind the textboxes in your 2nd session.
    Select textboxes displaymember.
    Use the move buttons to change the bindingsource position.
    thats it.
    Gotta go have a nice weekend.....
    Ooops if you use vs2003 you can't do what i tell you but the solution is kinda similar, maybe someone else can help you out on this, gotta go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width