Aspnet_users and Custom Tables

I recently read Scott Mitchell’s article series “Examining ASP.NET’s Membership, Roles, and Profile”. In Part 6http://www.4guysfromrolla.com/articles/101106-1.aspx, It says “to store additional, user-specific fields…If you are using the SqlMembershipProvider, this would mean creating an additional database table that had as a primary key the UserId value from the aspnet_Users table and columns for each of the additional user properties.”

I created a table named Thread to store some specific users information and comments they make. I set the ThreadId as the primary key and the UserId as the foreign key to the UserId in aspnet_Users table. But when I run the application and use a user’s account to submit a comment, there is an error in my Comments.aspx.vb page “Cannot insert the value NULL into column ‘UserId’, table ‘ASPNETDB.dbo.Thread’; column does not allow nulls. INSERT fails.The statement has been terminated.”

How can I make the logged-on user’s UserId inserted into the Thread table when storing the user’s other data information?

Hi USPatriot, thanks for your reply. I found the solution yesterday at http://forums.asp.net/t/1262258.aspx#2362821

Thanks anyway.

Joe

It would be benifical to see your code.