<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<html>
<head>
<title>Link Details Page Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server" src="fetchdata_sql.cs" />
<script language="C#" runat="server">
void Page_Load ( Object src, EventArgs e ) {
// define the query
string query = "SELECT * FROM Titles WHERE title_id='" +
Request.QueryString [ "titleid" ] + "'";
// fetch reader and bind to a datalist
myData.DataSource = fetchReader ( query );
myData.DataBind ( );
}
</script>
<body style="margin:0">
<!-- #include file="books_header.inc" -->
<div align="center">
<form runat="server">
<asp:datalist id="myData" width=60% runat="server"
enableviewstate=false>
<itemtemplate>
<div class="header">
<h3 style="color:maroon"><%# Eval ( "title" ) %></h3>
</div>
<table cellpadding=10>
<tr>
<td valign="top">
<img align="top" runat="server"
src='<%# Eval ( "title_id",
"~/shared/images/title-{0}.gif" ) %>'>
</td>
<td valign="top">
<p><%# Eval ( "notes" ) %></p>
<p>
<b>Category:</b> <%# Eval ( "type" ) %><br>
<b>Publisher ID:</b> <%# Eval ( "pub_id" ) %><br>
<b>Price:</b> <%# Eval ( "Price", "{0:c}" ) %>
</p>
</td></tr>
</table><br>
</itemtemplate>
</asp:datalist>
</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>