P
Paul Ilacqua
How do I persist a dataset to another procedure in a form IE
'Code
Public ds as Dataset
'Fill and use Dataset in LoadProjects but I want to use this dataset from
another sub in the same form class.
Private Sub LoadProjects()
Using objData As New OLEDBBase
ds = New DataSet
Try
With objData
..SQL = "Select PartNumber,Sum([OH INV]) From Inventory Group By PartNumber"
..InitializeCommand()
..OpenConnection()
'DS is Filled Here
..FillDataSet(ds, "Builds")
End With
Dim iCounter As Integer = 0
Dim row As DataRow
ListBox1.Items.Clear()
For Each row In ds.Tables(0).Rows
ListBox1.Items.Add(row(0))
Next row
objData.DataReader.Close()
ds.Clear()
Catch ExceptionErr As Exception
MessageBox.Show(ExceptionErr.Message, "Error")
End Try
End Using
End Sub
'Code
Public ds as Dataset
'Fill and use Dataset in LoadProjects but I want to use this dataset from
another sub in the same form class.
Private Sub LoadProjects()
Using objData As New OLEDBBase
ds = New DataSet
Try
With objData
..SQL = "Select PartNumber,Sum([OH INV]) From Inventory Group By PartNumber"
..InitializeCommand()
..OpenConnection()
'DS is Filled Here
..FillDataSet(ds, "Builds")
End With
Dim iCounter As Integer = 0
Dim row As DataRow
ListBox1.Items.Clear()
For Each row In ds.Tables(0).Rows
ListBox1.Items.Add(row(0))
Next row
objData.DataReader.Close()
ds.Clear()
Catch ExceptionErr As Exception
MessageBox.Show(ExceptionErr.Message, "Error")
End Try
End Using
End Sub