W
Wes Hutton via .NET 247
I am trying to pass a data object (set or row) into a functionbyref, and have the same issue either way. In the maincontroller function, I have no issues accessing any parts of mydataset. If I extract a data row, it has values and is fine. However, when I pass either the whole dataset or just a data rowto another function, it errors out, and in the Locals windowjust has "error: cannot obtain value" against every field. I'vecopied the code from another class where it works perfectly, cananyone suggest why it all of a sudden won't let me pass thedataset or components of the dataset successfully? Also, oncethis problem occurs, .NET won't let me set the next statementeither.
thanks for your help.
Sample code:
public sub controller()
<get the data here>
'this line works fine
dim intID as integer = objDataSet.Company(0).IDCompany
'now pass the dataset to the function
MapCompany(objDataSet) 'at this point dataset can beaccessed completely
end sub
private sub MapCompany(ByRef objDataset as CompanyDataset) asCompany
'at this point the data cannot be read any more
dim intID as integer = objDataset.Company(0).IDCompany
end sub
thanks for your help.
Sample code:
public sub controller()
<get the data here>
'this line works fine
dim intID as integer = objDataSet.Company(0).IDCompany
'now pass the dataset to the function
MapCompany(objDataSet) 'at this point dataset can beaccessed completely
end sub
private sub MapCompany(ByRef objDataset as CompanyDataset) asCompany
'at this point the data cannot be read any more
dim intID as integer = objDataset.Company(0).IDCompany
end sub