Sure, here's an example.
PAGE 1 ASPX
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" datakeynames="ProductID"
datasourceid="SqlDataSource1">
<columns>
<asp:boundfield datafield="ProductID" headertext="ProductID" readonly="True" sortexpression="ProductID" />
<asp:boundfield datafield="Name" headertext="Name" sortexpression="Name" />
<asp:hyperlinkfield datanavigateurlfields="ProductID" datanavigateurlformatstring="1120691B.aspx?ProductID={0}"
text="View Product" />
</columns>
</asp:gridview>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:AdventureWorksConnectionString %>"
selectcommand="SELECT [ProductID], [Name] FROM [Production].[Product]">
</asp:sqldatasource>
PAGE 2 ASPX
<asp:detailsview id="DetailsView1" runat="server" datasourceid="SqlDataSource1">
</asp:detailsview>
<asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:AdventureWorksConnectionString %>"
selectcommand="SELECT [ProductID], [Name] FROM [Production].[Product] WHERE ([ProductID] = @ProductID)">
<selectparameters>
<asp:querystringparameter name="ProductID" querystringfield="ProductID" type="Int32" />
</selectparameters>
</asp:sqldatasource>
Thanks, Ed
Microsoft MVP - ASP/ASP.NET
