Asp.Net components and Internet solutions
Quality Data

Asp.Net Database Table/Stored Procedures


The CardSpace Controls for Asp.Net require a database table, aspnetEx_InformationCards and four stored procedures in order to maintain the list of Information Cards that are associated with each membership user.


The database table

As illustrated, the CardSpace Controls require one table in addition to the standard Asp.Net Membership Tables.


This table, aspnetEx_InformationCards, allows each membership user to associate any number of information cards with the membership account. 

  • The ApplicationId/UserID columns are used to tie the card to the appropriate membership user account.
  • The PPID column contains the personal private identifier which is one of the claims provided when the information card is selected.
  • The Date columns are updated whenever the card is created or used.
  • Email, GivenName and Surname (first/last names) are required claims and provided with the card.
    CardInfo is reserved for future use.


Note: The "Ex" suffix on the table name distinguishes the table from the built in Asp.Net membership tables. "Ex" stands for "Extended", "Extra", "Exemplary", "Ex-wife" or whatever you like.


The Stored Procedures

All interaction with the Information Cards table is performed through the four (4) stored procedures:
  • aspnetEx_InformationCards_FindCardsByUserID
  • aspnetEx_InformationCards_DeleteCardForUserID
  • aspnetEx_InformationCards_CreateCardForUserID
  • aspnetEx_InformationCards_GetUserIDForCard
The script that creates these stored procedures also grants execute privileges to the aspnet_Membership_BasicAccess role, which is one of the security groups that is set up when the original Asp.Net membership schema was created.


Creating the Table/Stored Procedures


The script to create the table and stored procedures is built into the CardSpace Controls assembly and will be run automatically if the controls detect that the table/procs are missing. 

If you are using SQL Server Express in User Instance Mode (the default), then the various CardSpace Controls will be able to create the table/stored procedures automatically - no action should be required on your part.  Otherwise, you may run the CardSpaceControls.sql script (installed by Setup) to create the table/stored procedures.


You'll know that the CardSpace Controls were unable to create the required table/stored procedures if, at runtime, you receive an error message indicating that the table "AspNetEx_InformationCards is missing".  While you can use Visual Studio to run the script (File..Open..CardSpaceControls.sql), it is likely that your database has already been deployed to your web server.  The most practical approach would be to use the Query Analyzer feature of SQL Server Management Studio.  If you don't have this tool, Microsoft offers a free one here.

Setup installs the Sql script, CardSpaceControls.sql into your application directory (usually c:\program files\quality data\cardspace controls) but for your convenience it can also be downloaded here.



Additional information

The process of adding the extra required table/stored procedures was designed to be as painless as possible.  If you need additional help getting these set up, please visit our Support Forum. The complete API for the CardSpace Controls is available here.