Variant in VB6 to a VB.NET

J

John

Hi,

I have an COM object used in my VB.NET project. There's one function return
the result in Variant type so I have to convert it to object type.

Dim myValue as object

myValue = MyCOMobjectFunction

If I want to get value out of the myValue, I have to do this: myResult =
MyValue(0)

How can I convert it to dataset or something in VB.NET type?

Please help. Thanks
 
R

rawCoder

Hi John,

You may try CType or DirectCast.
Or if the Option Strict is set to Off , then i think you can just use =

Thank You,
rawCoder
 

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