Problem with Edit Role
I've been modding the code in the book and appropriate d/ls and ran into a small error and I'm stuck. In the edit role file I get this when I select a "Permission Category" from the listbox.
Table doesn't have a primary key.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.MissingPrimaryKeyException: Table doesn't have a primary key.
Source Error:
Line 105: DataTable categories = currentRole.Permissions.Tables["Categories"];
Line 106:
Line 107: DataRow currentCategory = categories.Rows.Find( categoryId );
Line 108: if (currentCategory != null)
Line 109: {
Source File: c:\inetpub\wwwroot\csharpstop\modules\users\admin\ editmiddle.ascx.cs Line: 107
Now I know what this error means but from the restored database, I only see one table that has a primary key and that's the user table. Anyone know what's going on here? Any help would be great. Thanks.
|