473,609 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't Pass object ByRef from DLL to Windows Form

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.

Nov 21 '05 #1
1 2017
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.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
8798
by: Vanessa | last post by:
Hi, I would like to know whether there's any way for me to pass an object by reference to another form? Regards Vanessa
3
3677
by: Alex Stevens | last post by:
Hi. I have a class and it exposes a property, which accepts a parameter collection object. I want the class to use the parameter object and update it. However I don't want to use a copy of the collection. So I innocently open up my class, and modify the Set sub to have BYRef instead of BYVal, and the IDE says 'Set' parameter cannot be declared as 'ByRef'. Why?
14
2498
by: Robin Tucker | last post by:
Although I've been working on this project for 8 months now, I'm still not sure of the difference between ByVal and ByRef. As most objects in VB are reference types, passing ByVal I've discovered allows me to store a reference to the object I passed by val, to change that object and for the change to be reflected in the callers copy of the reference (confused?). Well, what is byref for in that case? I'm coming from a C++ background...
1
1306
by: Terrance | last post by:
Hello, I was wondering if someone can help me understand something. Below is some code that I got from the MS website that is suppose to authenticate for the username and password on the local machine. I tested this code in VB.net 2003 in a WINDOW FORM class and it seems to work fine. However, when I test it in VB.net 2005 Express Edition it works for the login portion but it doesn't display the error message if the user name and password...
2
1125
by: aName | last post by:
How can this work ? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdragactionclasstopic.asp In Vbasic( see code below) e is pass ByVal so a copy is put on the stack when the handler is called and it is not suppose to have side effect. But they clearly do side effect e.Action = DragAction.Cancel To do that shouldn't we have at least ByRef Argument ????
8
1069
by: Henry Jones | last post by:
Using VB.NET 2005. I have a Function that I would like to pass the form name and the textbox name to. ----------------------------------------- Function DoSomeThing(byref frmOBJ as Object, byref txtOBJ as TextBox) as integer frmOBJ.txtOBJ.text = "Some text goes here"
6
4266
by: dav61000 | last post by:
I have a parent form that uses a Treeview Control and I would like to pass the node selected to a child form where the user will add update or delete the record selected using a dataset. Is there a way to pass the selected node as a parameter to the child form? Here's my code thanks in advance! Private Sub PopulateTreeView(ByVal inParentID As Integer, ByRef inTreeNode As TreeNode) objConn.Open() myReader =...
14
4818
by: Siegfried Heintze | last post by:
Why does VB.NET V2 force me to pass by value for my set function? When I try to change it to const byref it gives me a syntax error. It seems very inefficient to be passing strings around by value when a reference to a constant string object will do fine (all we are going to do is copy it). In my case, would the byval for the set function cause a superfluous copy? Thanks, Siegfried class person dim m_name as string
2
1094
by: Tanzen | last post by:
Here's what I'm trying to do in vb.net 2005. I have a public declared method that sets the value of a control on a form, but that form could change, so I don't want to code its actual name. I want it to be a parameter in the module method so that you pass the form name of whatever form called the method. So let's say we call the method from form 1: UpdateText(frmName)
0
8053
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8205
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5504
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4007
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4066
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1638
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1374
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.