Skip to Main Content
Professional Visual Studio® 2008
book

Professional Visual Studio® 2008

by Nick Randolph, David Gardner
July 2008
Intermediate to advanced content levelIntermediate to advanced
1026 pages
27h 59m
English
Wrox
Content preview from Professional Visual Studio® 2008

21.3. Object Data Source

In a number of projects, an application is broken up into multiple tiers. Quite often it is not possible to pass around strongly typed DataSets, because they may be quite large, or perhaps the project requires custom business objects. In either case, it is possible to take the DataBinding techniques you just learned for DataSets and apply them to objects. For the purposes of this discussion, use the following Customer and SalesOrder classes:

Public Class Customer
    Private m_Name As String
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(ByVal value As String)
            m_Name = value
        End Set
    End Property

    Private m_Orders As New List(Of SalesOrder)
    Public Property Orders() As List(Of SalesOrder)
        Get
            Return m_Orders
        End Get
        Set(ByVal value As List(Of SalesOrder))
            m_Orders = value
        End Set
    End Property
End Class
Public Class SalesOrder Implements System.ComponentModel.IDataErrorInfo Private m_Description As String Public Property Description() As String Get Return m_Description End Get Set(ByVal value As String) m_Description = value End Set End Property Private m_Quantity As Integer Public Property Quantity() As Integer Get Return m_Quantity End Get Set(ByVal value As Integer) m_Quantity = value End Set End Property Private m_DateOrdered As Date Public Property DateOrdered() As Date Get Return m_DateOrdered End Get Set(ByVal value As Date) m_DateOrdered = value End Set End Property Public ReadOnly Property ErrorSummary() As String _ Implements System.ComponentModel.IDataErrorInfo.Error ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Professional Visual Studio® 2010

Professional Visual Studio® 2010

Nick Randolph, David Gardner, Michael Minutillo, Chris Anderson

Publisher Resources

ISBN: 9780470229880Purchase book