Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 10th, 2005, 07:16 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old January 12th, 2005, 04:07 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well I guess I'm the only one who ran into this problem. Not a big deal. It now gives me an excuse to re-do the permission/roles code, tables, and the SPs Good was to learn and need the practice.

 
Old January 15th, 2005, 11:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

CategoryID is supposed to be the primary key on Accounts_PermissionCategories. If you don't have it designated as a PK, you're probably on the wrong version of the DB.

Eric
 
Old January 17th, 2005, 01:15 PM
Registered User
 
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the reply. That was probably the problem but no matter now. I totally redid the role/permissions page. Nice to see that I'm actually learning since I had not problems modding it to the way I wanted to handle users and roles.






Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with sitemap and role hertendreef ASP.NET 2.0 Basics 6 June 21st, 2007 05:22 PM
problem with accessibility and role hertendreef ASP.NET 2.0 Professional 1 June 19th, 2007 09:46 AM
GridView edit problem mike72 ASP.NET 2.0 Basics 8 January 3rd, 2007 07:59 PM
rich edit problem satishsatao Visual C++ 1 June 9th, 2006 02:20 AM
problem with role based authorization hotshot_21 ASP.NET 1.0 and 1.1 Basics 0 February 21st, 2006 08:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.