jamie_pattison
Well-known member
- Joined
- Sep 9, 2008
- Messages
- 116
- Programming Experience
- Beginner
I created a website using the following structure:
Class Project - Called DataAccessLayer > Added a Dataset > Add a tableAdapter and Datatable with a query called GetcustomersByID(ID)
Class Project - Called BusinessLayer > Created some code to call into the DataAccessLayer and return the results in a CustomerDataTable for the query GetcustomersByID(ID)
Web Project - Added a reference to the BusinessLayer.
From this point i can add an ObjectDataSource and tie it to the Business Layer and call the appropriate method (in this example GetCustomersByID(ID)).
I then wanted to add an extra layer where i was hoping to load all customer data into a customer object. So i add another class called Customers and add all the fields as properties (CustomerID, FirstName, Surname, AddressOne etc).
How could i load all the details from the BusinessLayer into this object, so i could write code such as
Dim myCustomer as Customer
....
...... Some code to get the data and load it into the Customer object.
If myCustomer.Firstname = "Bob" Then
....
End If
Thanks
Class Project - Called DataAccessLayer > Added a Dataset > Add a tableAdapter and Datatable with a query called GetcustomersByID(ID)
Class Project - Called BusinessLayer > Created some code to call into the DataAccessLayer and return the results in a CustomerDataTable for the query GetcustomersByID(ID)
Web Project - Added a reference to the BusinessLayer.
From this point i can add an ObjectDataSource and tie it to the Business Layer and call the appropriate method (in this example GetCustomersByID(ID)).
I then wanted to add an extra layer where i was hoping to load all customer data into a customer object. So i add another class called Customers and add all the fields as properties (CustomerID, FirstName, Surname, AddressOne etc).
How could i load all the details from the BusinessLayer into this object, so i could write code such as
Dim myCustomer as Customer
....
...... Some code to get the data and load it into the Customer object.
If myCustomer.Firstname = "Bob" Then
....
End If
Thanks