(Currently, the application's data model contains only the application services tables needed by the .) Let's create a very simple guestbook application where an authenticated user can leave a comment.
In addition to storing guestbook comments, let's allow each user to store his home town, homepage, and signature.
Figure 3: Use the Foreign Key Relationships Dialog Box to Manage a Table's Foreign Key Constraints (Click to view full-size image) Next, click the ellipses icon in the "Table and Columns Specifications" row on the right.
This will launch the Tables and Columns dialog box, from which we can specify the primary key table and column and the foreign key column from the table as the foreign key column (see Figure 4).
The table illustrates how to store information that shares a one-to-many relationship with user accounts.
Since each user account may have an arbitrary number of associated comments, this relationship is modeled by creating a table to hold the set of comments that includes a column that links back each comment to a particular user. We now need to associate three columns with each user account to store the user's home town, homepage, and signature, which will appear in his guestbook comments.
In this tutorial we will answer this question by building a very rudimentary guestbook application.
In doing so, we will look at different options for modeling user information in a database, and then see how to associate this data with the user accounts created by the Membership framework. NET's Membership framework offers a flexible interface for managing users.
In Steps 2 and 3 we will look at how the currently logged on user can view and edit their home town, homepage, and signature information.After adding this first field, marking it as the primary key, and settings its default value, your screen should look similar to the screen shot shown in Figure 2.Figure 2: Add a Primary Column Named tutorial, the Membership framework is designed to enable multiple web applications with different user accounts to share the same user store.This is evidenced by the methods and properties of the .Oftentimes, applications need to store additional user information not included in the Membership framework.
(Alternatively, you can launch this dialog box by going to the Table Designer menu and choosing Relationships.) Click the Add button in the lower left corner of the Foreign Key Relationships dialog box.