how to pass datasets as parameters

donjt81

Member
Joined
Jan 30, 2006
Messages
9
Programming Experience
Beginner
I am getting an error when i pass a dataset to a sub procedure.

I was debugging this step by step and this is what I discovered. Up untill the call to the procedure "createExport1", the dataset "Children" has all the correct values. It has the write number of tables, rows ... etc. But as soon as the code enters the module "createExport1" all the values for the dataset "Children" become
error: cannon obtain value
error: cannon obtain value
error: cannon obtain value
error: cannon obtain value
...
...
...

here are some parts of my code for better understanding.


VB.NET:
Public varStart As New Calc

Sub Main()
    varStart.LookIntoTable()
End Sub


VB.NET:
Public Class Calc

Public dbConnServer As SqlConnection

Public Sub LookIntoTable()
Dim Parent As String()
Dim Children As New DataSet
...
...
...
For i = 0 To Table.Rows.Count - 1
     Export(dbConnServer, Table.Rows(i)(0), Parent, Children)
Next
End Sub

Private Sub ExportENF(ByRef dbConn As SqlConnection, ByVal num As Integer, ByVal Parent As String(), ByVal Children As DataSet)
...
...
createExport1(filename1, Parent, Children, dbConn)
...
...
End Sub

'This is where the problem is
Private Sub createExport1(ByVal tfilename As String, ByVal Parent As String(), ByVal Children As DataSet, ByRef dbconn As SqlConnection)
...
...
...
End Sub

End Class
 
Back
Top