Tutorial:
MS SQL Server : Indexes - Auto Forms
Visual Studio 2005 ASP Web Site Forms Part 3
Dr. Thomas E. Hicks
Computer Science Department
Trinity University
This tutorial is a continuation of GridViews Part 2. See Below! It will continue to use Visual Studio Net ASPX web pages and Grid Views to render information contained in a Microsoft SQL Server Library database.
Prerequisite Software Configuration:
Visual Studio 2005, or later
SQL Server Management Studio or SQL Server Management Studio Express
Prerequisite Database: [The tutorial below will instruct you on how to get this same database into your Management Studio or Management Studio Express]
Get The Database
I recommend getting placing a copy of this database in either Microsoft Management Studio or Microsoft Management Studio Express so that you can work through this tutorial as you go. A copy of the tutorial can be downloaded below.
Upsize The Database
I recommend that you upsize this database in either Microsoft Management Studio or Microsoft Management Studio Express. If you are unsure how to do this, check out the tutorial below:
Tutorial:
MS SQL Server :
Tutorial Part 1 I recommend that complete the the first
tutorial in this series so that you can work through this tutorial as you go:
Import Access Database Into
SQL Server Management Studio
Tutorial: MS SQL Server : GridViews
Tutorial Part 2
I recommend that complete the the second tutorial in this series so that you can work through this tutorial as you go:
Tutorial:
MS SQL Server : GridViews
Visual Studio 2005 ASP Web Site Forms Part 2
1] The Library database is small and consists of only 6 tables. The Genre relates to the Books!

2] The Library database is small and consists of only 6 tables. The Majors relate to the Students!

3] A Check-Out Transaction occurs when a Student Checks out Books. A TransactionDetail is created for each and every Book checked out by the Student during a single Check-Out Transaction.

4] A Database Administrator might provide the following glimpse into the Library Database.

1] The StyleSheet.css code can be seen below:[See Below!]
/*******************************************
* Body Of The Orange-Blue Style Sheet *
*******************************************/
body
{
scrollbar-base-color: #21189C;
scrollbar-arrow-color: #FF8200;
background-color: #FF8200;
Color: #21189C;
font: color: #21189C;
font-family: 'sans serif',arial;
font-size: 12px;
font-weight: normal
}
/*******************************************
* Horizontal Rule *
*******************************************/
hr
{
border: 0;
height: 4px;
color: #21189C;
background-color: #21189C;
}
/*******************************************
* Data Table *
*******************************************/
table#Data
{
align:center;
font-family: 'sans serif',arial;
color: #21189C;
color: #21189C;
background-color: #D4D0C8;
border: solid #D4D0C8 4px;
border-spacing: 0px;
font-size: 10px;
font-weight: normal;
text-align: Left;
}
table#Data td
{
background-color: #D4D0C8;
// border: solid #000000 1px;
border: solid #D4D0C8 1px;
padding: 4px;
}
/*******************************************
* TriLeft Table *
*******************************************/
table#TriLeft
{
align:center;
border: solid #D4D0C8 0px;
border-spacing: 0px;
text-align: Left;
width:100%;
}
table#TriLeft td
{
padding: 0px;
}
/*******************************************
* More Bold Header *
*******************************************/
.BoldLabel
{
font-family: 'sans serif',arial;
font-size: 12px;
font-weight: bold;
text-align: Center;
}
/*******************************************
* Left Justified Data *
*******************************************/
.LeftData
{
text-align: Left;
}
/*******************************************
* Black-Blue Hyperlinks *
*******************************************/
A
{ font-family: 'sans serif',arial;
color: Black;
font-size: 16px;
font-weight: bold;
}
A:link
{
color:Black;
}
A:visited
{
color: Black;
}
A:hover
{
text-decoration: none;
color:#21189C;
font-size: 24px;
font-weight: bold;
}
A:active
{
color: red;
text-decoration: none;
}
1] Using the mouse, hold down the View Menu and select Server Explorer. All of the Data Connections are visible within this window. There are four database connections below. A single database connection to our Hicks-Library can be used for multiple web site projects; this database connection is referenced as Net1.Hicks-Library.dbo [See Below!]

2] This tutorial shall emphasize and discuss connections. Let us get rid of all of our connections. Not that all applications that use these connections will fail unless they are re-established.

1] Just as we did in the earlier project(s), create a new project in folder C:\Inetpub\wwwroot\Webs\Library-Form3. [See Below!]

2] Create style sheet StyleSheet.css and add the code. Apply the style sheet to Default.aspx. [See Below!]

3] Add a couple of panels and a label to Default.aspx. Make it look like the one below. [See Below!]

1] Rendering web sites on your system can sometimes be a problem. If your web server will not render a plain HTML page, it certainly will not render your Visual Studio designed web site. Let us start by creating a simple HTML page; I have named this page Test.html; it is placed in directory C:\Inetpub\wwwroot\Webs\Library-Form3 [See Below!]

2] We hope that the rendered value looks something like this. {See Below!]

1] In order to render this page, you must have some type of Personal Web Server or Internet Information Server installed you your system. On Windows 2000, Windows XP, or Windows 2003 server, you can add the web server by double-clicking on Add or Remove Programs in the control panel. {See Below!]

2] Using the mouse, click on the Add/Remove Windows Components button. {See Below!]

3] IIS can be installed by selecting the Application Server. I recommend double clicking on the Application Server and doing a custom configurations similar to the one below:. {See Below!]

4] Without ASP.NET, your Visual Studio created web site will not work. When you select IIS, you automatically get the COM+ access. The Application Server console shall make all of our configurations easier. {See Below!]

5] Without ASP.NET, your Visual Studio created web site will not work. When you select IIS, you automatically get the COM+ access. The Application Server console shall make all of our configurations easier. Double-click the IIS. {See Below!]

6] Select Common Files. Select Front Page Server Extensions. Select IIS Manager. Select World Wide Web. Double-click the World Wide Web. {See Below!]

7] Select Active Server Pages. Select Internet Data Connector. Select World Wide Web Service. Using the mouse, select OK. {See Below!]

8] Open http://localhost/Webs/Library-Form3/Test.html with your browser. {See Below!]

8] But suppose you have made all of the configuration changes cited above and are still unable to render the page. {See Below!]

9]You double check the directory and make sure that Test.html is where it should be and it is. {See Below!]

10] If it is not working, it is time to examine the security access.
1] The Internet Guest Account on your server has to have Read and Execute access. The computer used in this tutorial is called NET1; by default, the Internet Guest Account is called IUSR_NET1. All files and folders in this web site must have Rear and Execute permissions. [See Below]

2] At this point we should be able to render http://localhost/Webs/Library-Form3/Test.html with your browser. {See Below!]

1] Let us now make sure that your browser will render a plain ASP page, it certainly will not render your Visual Studio designed web site. Let us start by creating a simple ASP page; I have named this page Test.asp; it is placed in directory C:\Inetpub\wwwroot\Webs\Library-Form3 [See Below!]

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>HTML Page</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body style="text-align: center">
<strong><span style="font-family: Arial">Your Web Server WIll Render an ASP page.</span></strong>
<%
Response.Write "<P>Welcome To ASP<P>"
%>
</body>
</html>
2] We hope that the rendered value looks something like this. {See Below!]

3] If it is not working, it is time to examine the IIS Extensions.
1] Open the Internet Information Services Manager. Select the Web Service Extensions on the Left. Make sure that Active Server Pages are allowed.

2] At this point we should be able to render http://localhost/Webs/Library-Form3/Test.asp with your browser. {See Below!]

1] Launching the page with
.
Visual studio negotiates a port and launches the application, using the default
browser, on that negotiated port. The port address will not always be the
same. The port below is 1189. Note also that the address does not contain the
full path : C:\Inetpub\wwwroot\Webs\Library-Form3 [See Below!]

2] A web site would be pretty worthless if it could only be accessed by the user using Visual Studio on the server. Suppose we try to render this page with the browser. [See Below!]

1] ASP version 2, or later, must be installed in order to render Visual Studio created web sites. Open the Internet Information Services Manager. Select the Web Service Extensions on the Left. Make sure that ASP.NET version 2, or later, is installed and allowed. [See Below]

2] It is not enough to make sure that ASP.NET version 2, or later, has been installed and allowed; it must be associated with the default web site. Open the Internet Information Services Manager. Using the mouse, right mouse-click on the Default Web Site and select Properties. [See Below]

3] Use the drop down menu to make sure that ASP.NET version 2, or later, has been associated with the default web site. Using the mouse, select/push the OK button. [See Below]

4] You need to make sure that each and every folder in the path is associated with ASP.NEt 2.xor higher; for us, this includes webs. This is not enough. It still does not work, but we are getting close. [See Below!]

1] Open the Internet Information Services Manager. Expand the Default Web Site until you see folder Library-Form3. Using the mouse, right mouse click on Library-Form3 and select Properties. [See Below]



2] Push/Select the Create Application Name button. [See Below]

3] Push/Select the OK button. [See Below]

4] We are getting closer, but aspx pages require higher security requirements. [See Below]

1] ASPX requires that everyone have read and execute to all files and folders within the web site. [See Below]

1] If the ASPX page does not connect to a Microsoft SQL Server, this is sufficient to render your web site. [See Below]

1] ASP version 2, or later, must be installed in order to render Visual Studio created web sites. Open the Internet Information Services Manager. Select the Web Service Extensions on the Left. Make sure that ASP.NET version 2, or later, is installed and allowed. [See Below]









1] Our new web site is being created in directoy C:\Inetpub\wwwroot\Webs\Library-Form3. [See Below!]

1] Our new web site is being created in directoy C:\Inetpub\wwwroot\Webs\Library-Form3. [See Below!]

2] Note the change in the size of label text. Select the Document object of the Default.aspx form in the design view. Set the Hyperlink Properties Title to Library System Main Menu. Test It! [See Below!]
Tutorial:
MS SQL Server : GridViews
Visual Studio 2005 ASP Web Site Forms Part 3?