Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Thursday, September 14, 2006

3-tier Architecture with ASP.NET 2.0: Tutorial Declarative Parameters in Visual C# and VB.NET


In the last tutorial we looked at displaying data with the GridView, DetailsView, and FormView controls bound to an ObjectDataSource control that invoked the GetProducts() method from the ProductsBLL class. The GetProducts() method returns a strongly-typed DataTable populated with all of the records from the Northwind database's Products table. The ProductsBLL class contains additional methods for returning just subsets of the products - GetProductByProductID(productID), GetProductsByCategoryID(categoryID), and GetProductsBySupplierID(supplierID). These three methods expect an input parameter indicating how to filter the returned product information.

Using a Hard-Coded Parameter Value

For the first example, start by adding a DetailsView control to the DeclarativeParams.aspx page in the BasicReporting folder. From the DetailsView's smart tag, select <New data source> from the drop-down list and choose to add an ObjectDataSource.

Find the Article

Post a Comment

Anonymous said...

The blog is helpfull...
visit also [c#]