Re: Converting arraylist to string array

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Peter Rilling (peter_at_nospam.rilling.net)
Date: 02/18/04


Date: Wed, 18 Feb 2004 06:42:03 -0800

GetType is a method on the Object class and does not accept any parameters.
Try using "typeof" instead of "GetType".

"Andrew Banks" <banksy@nojunkblueyonder.co.uk> wrote in message
news:BHKYb.1919$BY4.18218101@news-text.cableinet.net...
> c:\inetpub\wwwroot\Consolejunkies\Global.asax.cs(71): 'string' denotes a
> 'class' where a 'variable' was expected
>
> "Rajiv R" <rajivraj007REMOVE-THIS@yahoo.com> wrote in message
> news:%237Ds1ti9DHA.1596@TK2MSFTNGP10.phx.gbl...
> > Hi Andrew,
> >
> > Could you post what problem you are facing?
> >
> > --
> > Cheers!
> > Rajiv. R
> > Rajspace.Org
> >
> > "Andrew Banks" <banksy@nojunkblueyonder.co.uk> wrote in message
> > news:MzKYb.1910$_e5.18427948@news-text.cableinet.net...
> > > Can anyone see aproblem with this line of code
> > >
> > > string rolelistarray = rolelist.ToArray(GetType(System.String));
> > >
> > > I'm getting a problem with the GetType(System.String) section
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: typeof keyword
    ... The real value of GetType() method would be when you don't know in advance ... the run time type of an object. ... instead of typeof() ... typeof would work with uninitialized entities - types. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Reg:differences between typeof and GetType
    ... typeof is an operator, it's resolved at compile time and operate over a ... GetType() is a method, you have to use it with an instance variable and is ... > with regards ...
    (microsoft.public.dotnet.languages.csharp)
  • GetType problem
    ... the object class is passed as a string. ... have found that calling "GetType" on this string, ... that assembly references can be given from an outside source and the type ...
    (microsoft.public.dotnet.general)
  • Re: Class Object and override
    ... Assuming that the Test class has a ToString() method overriding the base ... The same goes for the GetType() method. ... > in the string class. ... > I just wonder how can the Object class know what the class is because ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Class Object and override
    ... ToString() method in Object class that is called and when you have this ... below it's the GetType() method in the Object class that is called. ... When you call ToString on t, as it doesn't override ToString, it uses the ...
    (microsoft.public.dotnet.languages.csharp)