C# Tips and Tricks > Universal Database Administrator for ASP.NET / SQL Server
- Download the admin main project source files - 1.01 MB
- Download AdminLite (no login, no admin table, no customization required) - 978 Kb
- Download Admin2005 (ASP.NET 2.0) project source files - 1 MB
- Discussions/Comments/Suggestions
- Complete Article on the "Universal Database Administrator""

Introduction (Seven pages is all it needs)
This article describes an ASP.NET web module which can be added /customized in any SQL driven web application as a database administration module. When I first started with an admin section for a web application, I thought why not try to make something more general, a plug-n-play admin section which can be used for any SQL driven dynamic web application, and here is the result of the effort.
The target was:
- Create a self sufficient admin section which can be put into any SQL driven web application by changing the connection string for SQL Server in the web.config file.
- User needs to login before doing CRUD (Create/Read/Update/Delete) operations (Not required for the AdminLite version).
- There should be individual pages one for each operation (CRUD) which will take the tablename as the parameter.
-
A
dataAccessclass which wraps all the data access methods and returns the values or records as required. - CRUD operations for tables (you can create/read/update/delete tables).
- Filter records using custom SQL queries.
- Execute custom SQL statements on the database.
- Support for paging/sorting.
- Includes SQL injection workaround for the login page using regular expressions - latest update.
- Support for multiple images (binary data in SQL tables).
"A good way for non-IT people to have a look at the database without having to know anything about SQL" CK Max
(The above comment is about the first phase of the DB Admin tool. The updated version is much more advanced and is focused on IT users only.)

Article History
- Nov 25, 2005: First published.
- Nov 26, 2005: Removed the ID constraint as suggested by Marc Clifton. See assumptions above. New assumption: every table has one Primary Key which is the first field in the table.
- Nov 29, 2005: Added AdminLite - no login, no admin table, and no customization required. Just add your connection string and it's ready to go with a single assumption: every table has one Primary Key which is the first field in the table.
- Dec 1, 2005: Fixed the multiple paging and sorting bug (which crept in due to the first enhancement) reported by C K Max and jamesxd - thanks to both of you :).
-
Dec 11, 2005:
- Create/Read/Update/Delete and Truncate for tables after suggestion from jonny0.
- Filters records based on a custom query, after suggestion from mkrawats.
- Executes custom SQL statements on the database.
-
March 23 2006:
- SQL injection workaround for the login page, as suggested by Crap bag.
- Added automatic insertion of date/time for adding new records.
- April 12 2006: Support for multiple images (binary sata in SQL tables).
