Multiple tables

Last post 05-09-2008 7:34 AM by Geek-O. 4 replies.

Sort Posts:

  • Multiple tables

    05-05-2008, 2:03 PM
    • Loading...
    • Geek-O
    • Joined on 04-25-2008, 2:36 AM
    • Posts 29

     I have to collect a very large amount of data from the users at signup. To do this i have created the forms, and multiple tables to store the info in. My question is how do i link the tables together the way the  membership class does so that if one row is deleted in the users table the rows in the other tables are deleted as well. I believe it has to do with foreign key but i am not that versed on databases. Can someone help me out on this issue, which fields should be in each table to mark the rows as the same user and such?

    Filed under: , ,
  • Re: Multiple tables

    05-05-2008, 2:16 PM
    Answer

     create foreign keys and while declaration put

     ondelete cascade. -- for deleting rows when row is deleted from main table.

     u can also use -

     onupdate cascade -- for updating rows when main table is updated.

     hope it helps.
     

    Hope it helps.

    -Manas

    =======================================
    If this post is useful to you, please mark it as answer.
  • Re: Multiple tables

    05-05-2008, 10:01 PM
    • Loading...
    • Geek-O
    • Joined on 04-25-2008, 2:36 AM
    • Posts 29

    In Visual Studio 2008 what are the steps to add a table to the existing relationships auto created by the membership classes? I open the table definition in VS, right click and view relationships, i tried clicking the add relationship button to add a new table, but tables and columns specifications properties for the new relationship are grayed out and do not let me modify. Am i going about this wrong? 

  • Re: Multiple tables

    05-09-2008, 6:14 AM

    Hi Geek-O

    Why not use profile to manage those additional information? There is not build-in wizard for Visual Studio to create relationships between membership and custom database, In general, you can manually achieve this by writing a stored procedure that takes the username/userID as an foreign key to retrieve all the details from your custom table, Please refer to the example here: http://forums.asp.net/p/730224/730540.aspx#730540

    Best Regards
    XiaoYong Dai
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Multiple tables

    05-09-2008, 7:34 AM
    • Loading...
    • Geek-O
    • Joined on 04-25-2008, 2:36 AM
    • Posts 29

     The profiles would not be a good idea because it is a huge amount of information we are collecting on signup. Currently i have 7 tables of information collected. It is broken down into different categories so to speak. Storing all this information in one table would slow down the fetch process and such once we get a lot of users, i would imagine. I will look at the link you provided. Thank you for your help.

Page 1 of 1 (5 items)
Microsoft Communities
Page view counter