The business Object

You now have an initial application. We are going to convert the previous example, so instead of having code in the pageload event to access the data we want to present, we will use a component to connect to a datasource and return the data to be used on the Web Form. This object will have the following class structure:

  • Class Name— boProjectView

  • Attribute— DSN as String—Holds a DSN string used by the class.

  • Methods:

    • GetProjects() as DataSet— Returns a DataSet containing all projects in the database.

    • GetTasks (projid as integer) as DataSet— Returns all tasks that belong to a project whose primary key matches the passed parameter.

Because we are going to convert the initial Web Form code to use a class with the preceding structure, ...

Get Inside ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.