does anyone know how to translate this into VB.net from C# 
Author Message
 does anyone know how to translate this into VB.net from C#

I can find no equivalent functionality to this line of code in VB.

    string[] astrNames = Enum.GetNames(new XmlNodeType().GetType());



Tue, 08 Jun 2004 11:17:04 GMT  
 does anyone know how to translate this into VB.net from C#

Quote:
>I can find no equivalent functionality to this line of code in VB.

>    string[] astrNames = Enum.GetNames(new XmlNodeType().GetType());

Dim astrNames() As String = Enum.GetNames(GetType(XmlNodeType))

Mattias

===
Mattias Sj?gren (VB MVP)

http://www.msjogren.net/dotnet/



Tue, 08 Jun 2004 12:12:12 GMT  
 does anyone know how to translate this into VB.net from C#
Mattias
thats what I would have thought but the compiler throws an error
"Expected Expression"
Enums are used differently in C# Aren't  they?
I haven't investigated it yet, but this code is still missing
something
Thanks

On Fri, 21 Dec 2001 05:12:12 +0100, Mattias Sj?gren

Quote:

>Dim astrNames() As String = Enum.GetNames(GetType(XmlNodeType))



Tue, 08 Jun 2004 22:14:35 GMT  
 does anyone know how to translate this into VB.net from C#
Hi,

Place brackets around Enum and Mattias code will work. I guess the compiler
is confusing the class Enum and the keyword Enum:

Dim astrNames() As String = [Enum].GetNames(GetType(XmlNodeType))

/Per Hultqvist, MCP


Quote:
> Mattias
> thats what I would have thought but the compiler throws an error
> "Expected Expression"
> Enums are used differently in C# Aren't  they?
> I haven't investigated it yet, but this code is still missing
> something
> Thanks

> On Fri, 21 Dec 2001 05:12:12 +0100, Mattias Sj?gren

> >Dim astrNames() As String = Enum.GetNames(GetType(XmlNodeType))



Tue, 08 Jun 2004 22:26:42 GMT  
 does anyone know how to translate this into VB.net from C#
Hi,

yep, or use the full name as in System.Enum to avoid the ambiguity


Quote:
> Hi,

> Place brackets around Enum and Mattias code will work. I guess the compiler
> is confusing the class Enum and the keyword Enum:

> Dim astrNames() As String = [Enum].GetNames(GetType(XmlNodeType))

> /Per Hultqvist, MCP



> > Mattias
> > thats what I would have thought but the compiler throws an error
> > "Expected Expression"
> > Enums are used differently in C# Aren't  they?
> > I haven't investigated it yet, but this code is still missing
> > something
> > Thanks

> > On Fri, 21 Dec 2001 05:12:12 +0100, Mattias Sj?gren

> > >Dim astrNames() As String = Enum.GetNames(GetType(XmlNodeType))



Wed, 09 Jun 2004 01:19:52 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. doesanyone know how to translate this into VB.net from C#

2. Translate from C# to VB .Net

3. Wanted: Help translating arrays from C# to VB.NET

4. Translate C# to VB.NET

5. Please help translate C# to VB.NET

6. Please help translate C# to VB.NET

7. Convert VB.Net to C#, convert C# to VB.Net

8. Know anyone a good .NET/C#/Vb.net/ASP.NET/ADO.NET message board/mailing list/newsletter???????

9. Has anyone done this with VB .Net?

10. Has anyone done anything adventurous in VB.Net??

11. Please help in translate from C# to VB

12. Translating C# to VB

 

 
Powered by phpBB® Forum Software