Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
ASP.NET 3.5 Application Architecture and Design

You're reading from   ASP.NET 3.5 Application Architecture and Design Build robust, scalable ASP.NET applications quickly and easily.

Arrow left icon
Product type Paperback
Published in Oct 2008
Publisher Packt
ISBN-13 9781847195500
Length 264 pages
Edition Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Vivek Thakur Vivek Thakur
Author Profile Icon Vivek Thakur
Vivek Thakur
Arrow right icon
View More author details
Toc

Object Data Source Controls


We looked at the data source controls in the last chapter and saw how they replaced the data access code, but tightly coupled the GUI to the data methods. To overcome this problem, Microsoft introduced object data source controls, so that we can bind directly to business objects, making it possible to use them in a 3-tier architecture.

Let's see how using object data source controls will shape our application:

  1. 1. Create a new web project using VS.

  2. 2. Add a new form named datasource-customer.aspx.

  3. 3. Add an object data source control, as shown here (drag and drop the object data source control from the Data tab under ToolBox in VS):

  4. 4. Now, we need to configure this object data source control. We first need to set the Business object , where we select our customer class:

  5. 5. Then, we need to set the SELECT, UPDATE, and INSERT methods. For our sample, we will just set the SELECT method:

  6. 6. Then, we select Finish. We then add a GridView control on the same page and...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image