Hi,
"Steve Marshall" <st****@westnet .net.auwrote in message
news:11******** *************@z 35g2000cwz.goog legroups.com...
Yes, an approach like that has occurred to me, and I will pursue it.
It just doesn't seem to fit as naturally as I would like with the way
the IDE does things. Thanks for the reply.
<text snipped>
Here is some addition info:
After compiling the class (example) below, you can create an object Data
Source from it (Data Source's window, add new Data Source). Once you have
the Data Source you can use it with the WinForm designer and the DataTable
will only be loaded once when it's first used.
Imports WindowsApplicat ion1.SomeDBData SetTableAdapter s
Public Class GlobalCompanyDa taSource
Implements System.Componen tModel.IListSou rce
Public Shared _Table As SomeDBDataSet.C ompanyDataTable
Public Shared ReadOnly Property Table() As
SomeDBDataSet.C ompanyDataTable
Get
If (_Table Is Nothing) Then
_Table = New SomeDBDataSet.C ompanyDataTable
Dim cta As New CompanyTableAda pter
cta.Fill(_Table )
cta.Dispose()
End If
Return _Table
End Get
End Property
Public ReadOnly Property ContainsListCol lection() As Boolean Implements
System.Componen tModel.IListSou rce.ContainsLis tCollection
Get
Return False
End Get
End Property
Public Function GetList() As System.Collecti ons.IList Implements
System.Componen tModel.IListSou rce.GetList
Return Table.DefaultVi ew
End Function
End Class
If your form needs to contain global and a non global DataTable's which are
part of the same DataSet, then you could just use the DataSet on the Form
and then replace the fill line in Form_Load for the global DataTable, this
way you can still enforce referential integrity (fk constraints).
Private Sub Form_Load(...)
' fill lookup (global)
SomeDBDataSet.C ompany.Merge(Co mpanyGlobalSour ce.Table)
' fill master (non-global)
EmployeeTableAd apter.Fill(Some DBDataSet.Emplo yee)
End Sub
HTH,
Greetings