variant

Discussion in 'Microsoft ASP .NET' started by Guest, Dec 17, 2003.

  1. Guest

    Guest Guest

    what is the equivalent of a variant in .net?

    Thanks in advance
     
    Guest, Dec 17, 2003
    #1
    1. Advertisements

  2. Guest

    bruce barker Guest

    Object


    <> wrote in message
    news:...
    > what is the equivalent of a variant in .net?
    >
    > Thanks in advance
    >
    >
     
    bruce barker, Dec 17, 2003
    #2
    1. Advertisements

  3. Guest

    Teemu Keiski Guest

    The equivalent in .NET is the Object data type (object in C#).

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    <> wrote in message
    news:...
    > what is the equivalent of a variant in .net?
    >
    > Thanks in advance
    >
    >
     
    Teemu Keiski, Dec 17, 2003
    #3
  4. Guest

    Guest Guest

    My vb function in com+ is:

    public Function updatestatus(byval MessageControlIDas string ,byval Status
    as string,byref ErrMessage as variant, optional byval QueueErrorMessage as
    string ="")as variant

    I am trying to call this through com interop:

    object ReturnedValue;

    ReturnedValue = HVOUTInstance.UpdateStatusByMCID(MessageControlID,
    Status,ErrMessage, QueueErrorMessage);

    I get an error saying " cannot convert from 'object' to ref object'

    what should I do?

    thanks

    <> wrote in message
    news:...
    > what is the equivalent of a variant in .net?
    >
    > Thanks in advance
    >
    >
     
    Guest, Dec 17, 2003
    #4
  5. Object is the closest thing to it, since every thing in .NET - including
    primitive data types - is an object, a variable of object type can point to
    any data type.

    You should however get used to using strongly defined types like string, int
    etc and use object sparingly, for good practice if nothing else. Hard to
    bebug a huge list of objects.

    --
    Regards

    John Timney (Microsoft ASP.NET MVP)
    ----------------------------------------------
    <shameless_author_plug>
    Professional .NET for Java Developers with C#
    ISBN:1-861007-91-4
    Professional Windows Forms
    ISBN: 1861005547
    Professional JSP 2nd Edition
    ISBN: 1861004958
    Professional JSP
    ISBN: 1861003625
    Beginning JSP Web Development
    ISBN: 1861002092
    </shameless_author_plug>
    ----------------------------------------------

    <> wrote in message
    news:...
    > what is the equivalent of a variant in .net?
    >
    > Thanks in advance
    >
    >
     
    John Timney \(Microsoft MVP\), Dec 17, 2003
    #5
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Sparrow

    UDF Parameters always Variant - help!!

    John Sparrow, Jul 29, 2003, in forum: Microsoft ASP .NET
    Replies:
    0
    Views:
    203
    John Sparrow
    Jul 29, 2003
  2. Guest

    variant

    Guest, Dec 17, 2003, in forum: Microsoft ASP .NET
    Replies:
    1
    Views:
    161
    Natty Gur
    Dec 18, 2003
  3. Guest

    variant issue

    Guest, Dec 17, 2003, in forum: Microsoft ASP .NET
    Replies:
    1
    Views:
    120
    Chris Jackson
    Dec 17, 2003
  4. Replies:
    3
    Views:
    1,655
    Thomas 'PointedEars' Lahn
    Mar 20, 2006
  5. rkbnair

    How can I define type variant in c#?

    rkbnair, Jan 7, 2008, in forum: Microsoft ASP .NET
    Replies:
    4
    Views:
    428
    rkbnair
    Jan 7, 2008
Loading...

Share This Page