Adding Roles to ASP.NET Accounts - Exploring the Pro
(Page 4 of 4 )
Stop the application and open the Database Explorer window, and look at the Tables in the aspnetdb database. Open two tables, aspnet_Users (which lists all the users your database knows about) and aspnet_Profile (which lists the profile information for those users). To see these next to each other, click and drag the tab for one of the views, as shown in Figure 12-34.

Figure 12-34. Drag tab
When you let go, a menu will open offering to create a new tab group. Choose New Horizontal Tab Group, as shown in Figure 12-35.

Figure 12-35. Create New Horizontal Tab Group
This done, you can see both the Profile tab and the Users tab in a single window. The Users tab shows you that each user has a uniqueUserID. The Profile tab has a foreign key added into that table (UserID) and lists thePropertyNames andPropertyValues, as shown in Figure 12-36.

Figure 12-36. Profile tables
PropertyNamesmatches up with the entries you created in the<profile>section of Web.config:
<profile>
<properties>
<add name="lastName" />
<add name="firstName" />
<add name="phoneNumber" />
<add name="birthDate" type="System.DateTime"/>
</properties>
</profile>
Each property is named (e.g.,phoneNumber), given a type (Sfor string), a starting offset (phoneNumberbegins at offset5), and a length (phoneNumber’s value has a length of12). This offset and value are used to find the value within thePropertyValueStringfield.
Notice thatbirthDateis listed as a string, that begins at offset 17 and is 95 characters long; if you look at thepropertyValuesStringcolumn, you’ll find that the birthDate is encoded as XML.
Please check back next week for the continuation of this article.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
|
This article is excerpted from chapter 12 of the book Programming Visual Basic 2005, written by Jesse Liberty (O'Reilly, 2005; ISBN: 0596009496). Check it out today at your favorite bookstore. Buy this book now.
|
|