I have a winforms application with a strongly typed dataset that uses tableadapters and bindingsources to connect forms and data. I have a lot of lookup tables in my database. I want to load the lookup data in in a background worker on application start. I thought I found a way, but when a form within the application loads, it calls initializecomponent, which wipes out the data that is in that table. What is the best way to load the data into the dataset tables that can then be used across multiple forms, without having to fill the datatable on every form.
This is what I tried:
So when I open another form, EML_StaffingDataSet.TSTAFFSKILL would already be filled and I wouldnt have to fill it again.Code:Public Class dsglobal Public Shared EML_StaffingDataSet As EML_StaffingDataSet Public Shared Sub populateDS() EML_StaffingDataSet = New EML_StaffingDataSet End Sub Public Shared Sub loadskills() Dim ta As New EML_StaffingDataSetTableAdapters.TSTAFFSKILLTableAdapter ta.Fill(EML_StaffingDataSet.TSTAFFSKILL) End Sub End Class
Any help would be greatly appreciated.




Reply With Quote
