Hello
Im reading this article about the Gridview:
http://msdn.microsoft.com/msdnmag/is...4/08/GridView/
Whilst I realise that im not forced to use their methods I do find it
confusing that the article states that the code below is an example of the
"recommende d data binding approach in ASP 2.0".
Why is placing DAL level code and connection strings on every page that uses
data from a data store now the "recommende d approach"?
The idea seems completely stupid on every level.
Richard
<%@ Page theme="SmokeAnd Glass" %>
<html>
<head runat="server" />
<body>
<form runat="server">
<asp:TextBox runat="server" ID="EmpID" Text="3" />
<asp:button runat="server" Text="Refresh" />
<asp:SqlDataSou rce runat="server" ID="MySource"
ConnectionStrin g="SERVER=(loca l);DATABASE=nor thwind;Integrat ed
Security=SSPI;"
DataSourceMode= "DataSet"
SelectCommand=" SELECT firstname, lastname FROM employees WHERE
employeeid @MinID">
<SelectParamete rs>
<asp:ControlPar ameter Name="MinID" ControlId="EmpI D"
PropertyName="T ext" />
</SelectParameter s>
</asp:SqlDataSour ce>
<asp:GridView runat="server" ID="grid"
DataSourceId="M ySource"
AutoGenerateCol umns="true">
</asp:GridView>
</form>
</body>
</html>