473,799 Members | 3,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vb 6 Variant to C# object.

Hi,
I’m trying to use net remoteing with Com+. I created a wrapper for the com object. I can call the com object from my c# client and an able to get return type of strings and int’s. One of the methods returns a variant. I can get the object back from the com object but cannot convert it. I tried using adodb. examples I tried is.

object dept = obj.tryme();--- this wraps the com call which returns a variant.
ADODB._Recordse t rs = (ADODB._Records et) dept; and

OleDbDataAdapte r da = new OleDbDataAdapte r();
da.Fill(DS,dept , "test");

dept is the variant that is return from the com object. which is a recordset.
The current asp page uses it like this.
rsDept = objdept.getdepa rtment(1,"")
using the da.fill I get an exeception of
Unable to retrieve the IRowset interface from the ADODB.Recordset object.

The type of object retruned is system._comobje ct.

Any suggestions?

Thanks
Russ

Jul 21 '05 #1
0 1573

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

Similar topics

1
7269
by: C. N. Sridhar | last post by:
Hi, I'm writing a wrapper to a win32 dll in C#. I need to call a method in DLL which has a Variant type reference parameter. How to marshal variant type from win32 (unmanaged code) to C# (managed code)? I tried using Marshal.GetObjectForNativeVariant(), but of no use.
0
1116
by: Russ | last post by:
Hi, I’m trying to use net remoteing with Com+. I created a wrapper for the com object. I can call the com object from my c# client and an able to get return type of strings and int’s. One of the methods returns a variant. I can get the object back from the com object but cannot convert it. I tried using adodb. examples I tried is. object dept = obj.tryme();--- this wraps the com call which returns a variant. ADODB._Recordset rs...
19
2095
by: Jon Davis | last post by:
Hi guys! Just wanted to let you all know that I created a Variant structure, inspired by the old VB6 days. This is written in C#, but you can build a CLR/.NET class library assembly and reference it to your liking. ' Here is an example of use: ' start with a string of "1" Dim da As Variant = new Variant("1") ' add an integer of 2, becomes 3
0
319
by: Russ Gadagno | last post by:
Hi, I’m trying to use net remoteing with Com+. I created a wrapper for the com object. I can call the com object from my c# client and an able to get return type of strings and int’s. One of the methods returns a variant. I can get the object back from the com object but cannot convert it. I tried using adodb. examples I tried is. object dept = obj.tryme();--- this wraps the com call which returns a variant. ADODB._Recordset rs...
0
2025
by: dwinson | last post by:
I am writing an add-in in C# for a server written in VB6. In order for my add-in to work I need to implement this method: MyMethod(string inputData) .... so my C# code looks like this: public object MyMethod(string inputData)... I wrote a test harness in VB6 to test the method. I can call the method
2
4194
by: Heike | last post by:
Hello everybody, I have a Problem with C Sharp. I have to use external functions in DLLs. This Functions are written in Visual C++ 6 like this: int (__stdcall *GetGlobalValue) (VARIANT Appl, VARIANT &vRetVal); Now for the first time I want to use C Sharp and I find some examples to use Functions in extarnal DLLs, but I don't know how to cast the Variant-Paramters in C Sharp.
7
2150
by: Tracks | last post by:
I have old legacy code from vb5 where data was written to a file with a variant declaration (this was actually a coding error?)... in vb5 the code was: Dim thisdata as integer Dim thatdata Dim someother as integer thatdata = ubound( Array1 )
0
1184
by: MikalE | last post by:
I’m using a third-party ActicveX component that has the following description for one of its events: They mean by this that LocationType is an array of VARIANTS (containing enumeration) When the OnAlarm Event is raised I have problems getting the 3 last values from it. I have ported my application from VB.Net to C# and this is the only problem I can’t figure out how to solve in doing so. In VB.Net it’s very easy to access these...
4
12154
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
How can I define type variant in c#?
0
9541
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,...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.