Sunday, May 27, 2007

NetTiers and Custom Stored Procedures for Views

When creating a grid or combo box grid for a list of records, rows a good norm is to do the following:

- Create a VIEW of the records and the layout we want to use for the grid.
- Create a stored procedure that selects all columns in the view by using any set of parameters.

The stored procedure should use the following naming convention so that nettiers will create the proper service and add it to other view services.:
- _{Name of view}_{stored procedure name}

Sample:
VIEW: VIEW_ActiveCustomers
SP: _VIEW_ActiveCustomers_GetByCustomerID

You can then use code like:
VIEW_ActiveCustomersService service = new VIEW_ActiveCustomersService();
VList customersView;
customersView = service.GetByCustomerID(1);

No comments: