VB Code:
<Serializable(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Diagnostics.DebuggerStepThrough(), _
System.ComponentModel.ToolboxItem(true)> _
Public Class dsBooking
Inherits DataSet
Private tableBookingDetail As BookingDetailDataTable
Public Sub New()
MyBase.New
Me.InitClass
Dim schemaChangedHandler As System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
AddHandler Me.Tables.CollectionChanged, schemaChangedHandler
AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
End Sub
'Blah blah blah
<System.Diagnostics.DebuggerStepThrough()> _
Public Class BookingDetailRow
Inherits DataRow
Private tableBookingDetail As BookingDetailDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableBookingDetail = CType(Me.Table,BookingDetailDataTable)
End Sub
'blah blah blah
End Class
End Class
This strongly typed DataRow is declared, Public Class bit, inside the strongly typed dataset.
As you can see the DataSet is Serializable, but the DataRow doesn't have this.
I cannot stopre the entire dataset as a function I have only returns a strongly typed datarow:
VB Code:
Public Function FetchBookingToEdit(ByVal BookingKey As Integer) As Booking.BookingDetailRow
Dim SQL As String = EditSQL
SQL &= "WHERE BookingKey = @BookingKey "
Dim Comm As New Mowlem.Data.DataLib.Command(SQL)
Comm.Parameters.Add("@BookingKey", BookingKey)
Dim dt As New Booking
MyBase.DataLib.FillDataTable(Comm, dt.BookingDetail)
If dt.BookingDetail.Rows.Count = 1 Then
Return dt.BookingDetail.Item(0)
End If
End Function
Where the booking class, Dim dt As New Booking, inherits my strongly typed dataset.
Woof