473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Another try.... What to use to pass data from VB dll to C#?

Hello,

I tried this question prior and got no response, so thought I would try
to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and
C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from
the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this
would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass
an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string
and convert)

The C# app should: Be able to iterate through the returned object and
evaluate the information.

Thanks in advance,

Andrew Mueller
Nov 13 '05 #1
3 3166
Andrew,

This is really all up to you. You can export .NET types to COM, and
they should be accessible to VB (if the types you are creating/using are
Automation compatable). Subsequently, you can import COM types into .NET.

This means that you could have the VB dll use a DataSet or use an
ADODB.Recordset, it's really up to you. You just have to make sure that it
interops well. It's probably easiest to have the VB6 dll work with
recordset objects. However, if you want to take advantage of ADO.NET, you
will have to perform conversions between ADO.NET data sets and
ADODB.Recordsets.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni**************@exisconsulting.com

"Andrew Mueller" <am******@ins3.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,

I tried this question prior and got no response, so thought I would try to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string and convert)

The C# app should: Be able to iterate through the returned object and evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #2
What ever "object" you pass, you have to have a reference to a .NET wrapped
version of that object. My personal feeling is passing the data as XML is
your best option. If you do this right (ie, follow the DataSet schema), you
can move data from COM into a .NET DataSet.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge

************************************************** **************************
****
Think Outside the Box!
************************************************** **************************
****
"Andrew Mueller" <am******@ins3.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,

I tried this question prior and got no response, so thought I would try to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string and convert)

The C# app should: Be able to iterate through the returned object and evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #3
What type of data? Is it the type of data that will break down nicely
to a primitive type like a byte array or int array? You can pass
strings easily enough, so if you can serialize or string-represent
your objects, that's a consideration. You can use ADO recordsets in
..NET so passing a disconnected ADO recordset is an option.

"Andrew Mueller" <am******@ins3.com> wrote in message news:<#z**************@TK2MSFTNGP12.phx.gbl>...
Hello,

I tried this question prior and got no response, so thought I would try
to explain differently..

I am not sure which type of object to pass between a VB 6.0 ActiveX dll and
C#. I am wrapping a COM object because I am having issues with the types
that C# does not seem to understand. I need to be able to use a method from
the VB 6.0 dll which will query a proprietary data structure. I then need
to return this and iterate through it in C#. I would prefer some type of
recordset object, but am not sure what needs to be done. I would think this
would be simple, but not sure...

Any idea how I can either: 1. Pass a recordset object -OR- 2. Pass
an array -OR- 3. Pass some other object which makes sense

The VB dll should: Be able to take parameters and return a set of
data (Date/Time and Value(single/double/string - or I can force it to string
and convert)

The C# app should: Be able to iterate through the returned object and
evaluate the information.

Thanks in advance,

Andrew Mueller

Nov 13 '05 #4

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

Similar topics

1
by: Joe | last post by:
I am trying to write a Perlscript to be used with some HTML pages. Here is how it works: 1.. The first HTML page has a form which requests for user input. Then it passes the QUERY_STRING...
2
by: Miguel Orrego | last post by:
Hi, I have a page that pulls data from a database, one of the fields is Notetext which frequently contains an email. I then want to pass this onto another page, that updates the email field in...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
6
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
7
by: Dave | last post by:
I have two forms, Form1 and Form2. From Form2, how do I reference the value in a control on Form1? Or perhaps a more specific question: Form1 contains a textbox with the value of 10. This form...
4
by: tom | last post by:
Hi Experts, I want to pass the selectedDate value from my calender form to another web form or a web user control. Could you please show me how to do this? Thanks in advance.
8
by: Chris | last post by:
Hi, I have two froms (form1 and form2). I want to be able to pass values from form 1 to form2 and be able to use those values leter in form2. This is my code for form1 Private Sub...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
3
by: colleen1980 | last post by:
Hi: Can any one please help me when user select 2 dates from DDLDate1 10/09/2006 and DDLDate2 10/12/06 and the name and it close the form. I need to create multiple records in the another table on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.