I have implemented a 3-tier arhitecture which can be seen in below link
In the example above it uses a DataTable as sqldatasource and binds it to the gridview with below code.
GridView1.DataSource = Client.GetClients();
GridView1.DataBind();
However my datasource is not a datatable, it is a regular sqldatasource where you can edit, delete, and update. So I don' know how can it be seperated from my presentation layer or should it be really seperated?. Here my sqldatasource's codes:
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyDbConn %>"
DeleteCommand="DELETE FROM [OrderDetail] WHERE [RowNo] = @RowNo" InsertCommand="INSERT INTO [OrderDetail] ([FileNo], [PONumber], [MaterialCode], [MaterialDescription], [MaterialCategory], [UnitOfMeasure], [Quantity], [ContainerType], [LoadingDate]) VALUES (@FileNo, @PONumber, @MaterialCode, @MaterialDescription, @MaterialCategory, @UnitOfMeasure, @Quantity, @ContainerType, @LoadingDate)"
SelectCommand="SELECT * FROM [OrderDetail]" UpdateCommand="UPDATE [OrderDetail] SET [FileNo] = @FileNo, [PONumber] = @PONumber, [MaterialCode] = @MaterialCode, [MaterialDescription] = @MaterialDescription, [MaterialCategory] = @MaterialCategory, [UnitOfMeasure] = @UnitOfMeasure, [Quantity] = @Quantity, [ContainerType] = @ContainerType, [LoadingDate] = @LoadingDate WHERE [RowNo] = @RowNo">
<DeleteParameters>
<asp:Parameter Name="RowNo" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="FileNo" Type="Int32" />
<asp:Parameter Name="PONumber" Type="String" />
<asp:Parameter Name="MaterialCode" Type="String" />
<asp:Parameter Name="MaterialDescription" Type="String" />
<asp:Parameter Name="MaterialCategory" Type="String" />
<asp:Parameter Name="UnitOfMeasure" Type="String" />
<asp:Parameter Name="Quantity" Type="Int32" />
<asp:Parameter Name="ContainerType" Type="String" />
<asp:Parameter Name="LoadingDate" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="FileNo" Type="Int32" />
<asp:Parameter Name="PONumber" Type="String" />
<asp:Parameter Name="MaterialCode" Type="String" />
<asp:Parameter Name="MaterialDescription" Type="String" />
<asp:Parameter Name="MaterialCategory" Type="String" />
<asp:Parameter Name="UnitOfMeasure" Type="String" />
<asp:Parameter Name="Quantity" Type="Int32" />
<asp:Parameter Name="ContainerType" Type="String" />
<asp:Parameter Name="LoadingDate" Type="String" />
<asp:Parameter Name="RowNo" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
SqlDataSource does not fit into 3 tier architecture. It is up to you how you would do it. You don't have to separate it, but if you want to have a proper 3 tier architecture here, you need some kind of a database handling class in your data layer with CRUD operations.
The article you linked explains this clearly. If you dont want to use the DataTable, you can create your own POCO objects to handle data like
public class Order {... }
Your business tier method would look like
List<Order> GetOrders(...) {...}
and data
//CRUD naming convention
List<Order> ReadOrders (...) {...}