<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<html>
<head>
<title>Link Details Page Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<style type="text/css">
.header {
width:100%; height:18pt;
font:bold 13pt verdana; color:#033;
filter:shadow ( color=#cccccc ); padding-left:8}
.desc {
font:bold 11pt arial,verdana,sans-serif; background:khaki;
border:1px inset; padding:10; margin-bottom:10}
.specs {
font-size:9pt; background:beige;
border:1px inset; padding-right:5}
</style>
<script language="C#" runat="server" src="fetchData_oledb.cs" />
<script runat="server">
void Page_Load ( Object src, EventArgs e ) {
// define the query
string query = "SELECT * FROM Products where ProductCode='" +
Request.QueryString [ "id" ] + "'";
// fetch reader and bind to a datalist
prodSpecs.DataSource = fetchReader ( query, "dbtutor" );
prodSpecs.DataBind ( );
}
</script>
<body style="margin:0">
<!-- #include file="advworks_header.inc" -->
<div align="center">
<form runat="server">
<asp:formview id="prodSpecs" runat="server"
width=80% enableviewstate=false>
<itemtemplate>
<table width=100% cellpadding=8>
<tr valign="top">
<td colspan=2>
<div class="header"><%# Eval ( "ProductName" ) %>
<span style="color:#600"><%# Eval ( "UnitPrice", "{0:c}" ) %></span>
</div>
</td></tr>
<tr valign="top">
<td width=30% align="center">
<img border=0 src='<%# Eval ( "ProductImageUrl" ) %>'
alt='<%# Eval ( "ProductName" ) %>'>
</td>
<td>
<div class="desc"><%# Eval ( "ProductDescription" ) %></div>
<br>
<table width=100% class="data" cellspacing=1 style="font-size:8pt; background:slategray">
<col width=35%>
<tr><th align="right">Stock ID: </th><td><%# Eval ( "ProductCode" ) %></td></tr>
<tr><th align="right">Available Sizes: </th><td><%# Eval ( "ProductSize" ) %></td></tr>
<tr><th align="right">Product Category: </th><td><%# Eval ( "ProductCategory" ) %></td></tr>
<tr><th align="right">Product Type: </th><td><%# Eval ( "ProductType" ) %></td></tr>
</table>
</td></tr>
</table><br>
</itemtemplate>
</asp:formview>
</form>
</div>
<hr size=1 width=92%>
<div class="small"><a onMouseOver="status='Back to List';return true" href="javascript:history.go ( -1 )">Back to List</a></div>
<br>
</body>
</html>