Wednesday, March 7, 2012

My Table that uses aspnet foreign Keys wont display anything - CAUTION - Noob at work

I've created a new table in ASPNETDB.mdf called 'customerInfo'. Most of the fields are, for the moment, data that exists in one of the existing ASPNET tables eg Membership_UserId (primary key), Membership_Email, Users_UserName etc.; the list goes on. I have put a new column 'amountspent' - just to test that I can do what I think I can do, however the table doesn't display any data. Am I OK in thinking that I can use the aspnet data in my own tables and reference through foreign keys to them. I've made sure that the procedure that I used to put the table into a gridview on the webpage is OK as I did the same thing to the membership table and that displays all of its data. Can someone either explain the steps I need to make this happen correctly or point me in the direction of a noob type walkthrough.

Thanks

ps I've used several different ways to link the tables. First I tried building the relationships through the SqlMembershipProvider, created tables and added the foreign keys. Not sure of whether I'd done this correctly, I then used the diagram method which is pretty straightforward, however the result is the same. Surely now these tables are keyed to the UserId of aspnet_Users they should build and display a table of my existing test membership - even if the other fields, for the moment, are not carrying any data?

No comments:

Post a Comment