Relationships within a DataSet for updates

From: JLatA1st (jleite_at_amerifirstinc.com)
Date: 02/23/04


Date: Sun, 22 Feb 2004 19:36:06 -0800

I have a Database that resides on SQL Server 2K that has five tables:

    Files
        FileID [PrimaryKey]
        BrokerID [ForeignKey to Brokers]
        dtCreated

    Brokers
        BrokerID [PrimaryKey]
        Name
        Address1
        Address2
        City
        Region
        PostalCode

    BrokerContacts
        ContactID [PrimaryKey]
        BrokerID [ForeignKey to Brokers]
        Name
        Phone
        Fax
        Email

    BrokerLicenses
        LicenseID [PrimaryKey]
        BrokerID [ForeignKey to Brokers]
        State
        dtVerified

    BrokerNotes
        NoteID [PrimaryKey]
        BrokerID [ForeignKey to Brokers]
        dtEntered
        UserName
        Note

To manage this data the user has a Windows Form designed in C#. On this form there is text boxes that allow for the input or modification of the Brokers table. There are also four grids that show the Broker Contacts, Broker License Information, Files associated with the broker, and Broker Notes. The Licenses and Contacts they can modify as they wish (add, delete, modify). The Files grid is just a list of the files associated with the broker (File Number[FileID] and the Creation Date [dtCreated]). The note grid is read only but I they have a text box that they can type a note in and a button that will submit the note along with a DateTime stamp and the user name then refresh the grid.

My issue is this: I would like to create a single DataSet for this Windows Form that will allow the user to change information in the Brokers table (for the record they are in) as well as add/delete/modify Broker Contacts and Licenses, along with allowing the functionality for, me the programmer, to add notes programatically utilizing the same dataset so as to use the dataset's updating functionality.

In summary I would like to utilize this form in an MDI scenario where they can have multiple brokers within the parent. Should they close down a broker window I want to be able to tell them that they have changes and prompt them on whether to submit or clear the updates. Or if they close down the parent window I can scroll through the child windows and see if they have changes pending in one dataset for each of the child forms then send a cancel update or commit update command to that child form before closing it.

Thanks for the help.