Limit the number of entry in a database  
Author Message
IrishWolf





PostPosted: .NET Framework Data Access and Storage, Limit the number of entry in a database Top

Hey everyone, I want to make a demo disk of the program I just built, how would I limit the number of entries one could place on the database. Thanks


.NET Development27  
 
 
Jeff Wharton





PostPosted: .NET Framework Data Access and Storage, Limit the number of entry in a database Top

When doing your inserts, count the number of rows and throw an exception if 10.

If you are using Stored Procs, this is very easy and can all be done with one call to the DB. If you are using inline SQL, you will need to make multiple calls to the DB.