Click here to Skip to main content
15,878,748 members
Articles / Web Development / IIS

Universal Database Admin for ASP.NET and SQL Server (Reloaded)

Rate me:
Please Sign up or sign in to vote.
4.91/5 (87 votes)
15 Apr 20068 min read 436.6K   9.6K   200  
A dynamic web application needs an admin section for CRUD actions on the records/tables in the database. Wouldn't it be nice to have a database admin, which can be plugged to any web application? Just give your SQL connection string and it dynamically manages all table operations in just five pages.
<%@ Page CodeBehind="Viewdata.aspx.cs" Language="c#" AutoEventWireup="false" Inherits="Admin.Viewdata" %>
<HTML>
	<HEAD>
		<TITLE>.:Universal Data Admin:. - Welcome </TITLE>
		<%
if (Session["Admin"] == "true")
{
}
else{
Response.Redirect("index.aspx");

 }
%>
<SCRIPT language="JavaScript1.2">
function openwindow(s)
{
	window.open(s,"mywindow","menubar=0,resizable=1");
}
</SCRIPT>
		<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	</HEAD>
	<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" MARGINWIDTH="0" MARGINHEIGHT="0">
		<center>
			<TABLE cellSpacing="0" cellPadding="0" width="798" bgColor="#ffffff" border="0">
				<TR>
					<TD vAlign="top" bgColor="#ffffff" rowSpan="2">
					</TD>
					<TD width="605" colSpan="2">
					</TD>
				</TR>
				<TR>
					<TD vAlign="top" width="405">
						<TABLE id="Table1" height="407" cellSpacing="0" cellPadding="0" width="100%" bgColor="#ffffff"
							border="0" valign="top">
							<tr vAlign="top">
								<td colSpan="2"><IMG alt="" src="images/Admin.gif"></td>
							</tr>
							<tr>
								<td height="5" colspan="2"><font size="2" color="#006699="arial"><%Response.Write ("Welcome: " + Session["userfullname"] + " :: <a href =logout.aspx>Logout</a>"); %></font><br>
									<br>
								</td>
							</tr>
							<tr>
								<td colSpan="2" height="10"><font size="2" color="#006699="arial"></font><br>
									<h5>&nbsp;&nbsp;<A href="dbmain.aspx"><SPAN style="TEXT-DECORATION: none"><FONT face="arial" color="#006699">&lt;&lt; 
										Back to Main Page</h5>
									</SPAN></FONT></A></td>
							</tr>
							<tr>
								<td width="4%"></td>
								<td vAlign="top" align="center">
									<form id="frmViewState" action="ViewData.aspx" method="post" runat="server">
										<TABLE height="85" cellSpacing="0" cellPadding="0" width="372" border="0" ms_2d_layout="TRUE">
											<TR vAlign="top">
												<TD width="10" height="15"></TD>
												<TD width="362" valign="middle">
													<asp:Button id="Button1" runat="server" Text="<- Back to List"></asp:Button><asp:Label id="lblstatus" runat="server" Font-Size="Smaller" ForeColor="#004000" Font-Names="Verdana"
														Font-Bold="True">&nbsp;</t>VIEW RECORD: Ready </asp:Label><br>
													<br>
												</TD>
											</TR>
											<TR vAlign="top">
												<TD height="15"></TD>
												<TD><asp:table id="Table2" width="361" runat="server" border="1" height="45" GridLines="Both" HorizontalAlign="Center"
														Font-Name="Verdana" Font-Size="8pt" CellPadding="1" CellSpacing="0"></asp:table></TD>
											</TR>
											<TR vAlign="top">
												<TD height="15"></TD>
												<TD></TD>
											</TR>
											<TR vAlign="top">
												<TD height="25"></TD>
												<TD><asp:Button id="btnBack" runat="server" Text="<- Back to List"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;
													<asp:button id="btnSubmit" runat="server" text="Update Data"></asp:button>&nbsp;&nbsp;&nbsp;
													<asp:button id="Button2" runat="server" text="Delete Data"></asp:button>
												</TD>
											</TR>
										</TABLE>
									</form>
								</td>
							</tr>
							<tr>
								<td colspan="2"><!--#include file="includes/bot.htm"--></td>
							</tr>
						</TABLE>
					</TD>
				</TR>
			</TABLE>
		</center>
	</BODY>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Founder Teamcal AI
United States United States

Comments and Discussions