Can't Pass object ByRef from DLL to Windows Form

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.
 
M

mjhillman

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top