Creating a Web Form with a multiple data tables in Visual Web Developer 2005

  • I am trying to create a form where users can enter new Title information, the title header information is being stored in a table called Books. In addition to the information stored in Books I have another table called Subjects the Subjects table has the BookID in it as a foreign key, each book can have multiple subjects. Tables Books - BookID (varchar50) Primary Key - Title (varchar50) Subjects - iSubjectID (int) Primary Key auto-increment - BookID (varchar50) - Subject (varchar50) What I want to accomplish is when the form loads if the book has subjects tied to it display them in a detailsview (dvSubject) with paging turned on allowing the user to edit and delete however on insert I do not want to make the user have to type the BookID it should be able to pull it from dvBook. If when the form loads and does not have any subject records tied to that book I would like dvSubject to display with defaultmode=insert so users can add a subject if they want to. I have alot more fields to add but I wanted to keep this as simple as possible and have been racking my brain on how to do this and I know it can not be that hard, below is the code that I have so far for this. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="BookEntry.aspx.vb" Inherits="BookEntry" %> Untitled Page   


  • I found the answer to the foreign key issue so I thought I would post this prior to canceling my question... If you change the Update and Insert Parameters of odsSubject from: to this will save the user having to type in the BookId







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Creating a Web Form with a multiple data tables in Visual Web Developer 2005 , Please add it free.
    edit