Can't Pass object ByRef from DLL to Windows Form

  • Thread starter Thread starter mjhillman
  • Start date Start date
M

mjhillman

I have a web project (ASP.Net/VB.net) with a data access layer class
that passes dataset objects to the web form based on a passed SQL
query.

I tried to reuse this class in a VB.Net Windows form but the ByRef
dataset variable is empty after the call to the data access layer. The
class successfully retrieves the data but the ByRef dataset variable is
empty when examined in the Windows form.

I wrote the same code as a C# Windows Form and it worked fine.

The data access layer is written in VB.Net. I am using Windows 2003
Server.

Any ideas as to why the ByRef dataset variable is losing the dataset
data?

Thanks.
 
Found the cause of this problem to be subsequent call to another
function in the data access layer that passed a structure ByVal instead
of ByRef. Have no idea why this affected the contents of the dataset
in a previous unrelated funciton call, but by changing the structure
variable to ByRef the dataset retained its data.
 
Back
Top