1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Many To Many Relationship In Windows Form How I Represented It(I Need Only Forms Not Code)

Discussion in 'C#' started by ahmedsa, Jan 23, 2014.

  1. #1
    I make many to many relationship in erd diagram in sql server 2005 between car and driver as following
    car table
    driver table
    car_driver table.
    I need to make fleet management program. When I make forms in windows form are i make
    car form
    driver form
    car_driver form
    When i insert data are creating three forms each form insert to related tables
    car table car form
    driver table driver form
    car_driver table car_driver form
    please help me
    SEMrush
     
    ahmedsa, Jan 23, 2014 IP
    SEMrush
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,630
    Likes Received:
    724
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Not really sure what you're asking, but as I understand it, you're trying to make a management / admin-interface for assigning fleet cars - and show which driver has which car?
    If so, why not just have a table for cars, one for drivers, and perhaps a single table for assignments
    Car-table:
    ID, make, model, size, facilities, etc (all info you need for each car, basically)
    Driver-table:
    ID, name, abilities, special qualities etc. (all info pertaining to each driver)
    Assignment-table:
    car-ID (foreign key from car-table, ID), driver-ID (foreign key from driver-table, ID), time, place, etc. for each assigment

    You only need one form, with a select/dropdown for cars, drivers and extra info - all the info from this is stored in the assignment table

    If you also need forms to add cars and drivers, you will have these separately, of course

    You can then also limit the availability on cars and drivers by checking to see which cars and drivers are already assigned when someone tries to use the form (based on assignment dates etc.)
    Also, if you have different types of cars etc. you could create a form which limits the selection based on what is stored in the database, based on earlier selections in the assignment form.

    Apologies if I misunderstood your post - it was a bit unclear as to what you were actually asking.
     
    PoPSiCLe, Jan 23, 2014 IP