@object[] { 0 }  Parameter Error in Method

Posted on 2006-05-05
Last Modified: 2011-10-03
I am receiving the following errors on the following line of code, can some please help??

The type or namespace name 'object' could not be found (are you missing a using directive or an assembly reference?)

A field initializer cannot reference the nonstatic field, method, or Property

Argument '5': cannot convert from 'object[]' to 'object[] [c:\windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll]'

 itemType.InvokeMember(identityField, System.Reflection.BindingFlags.DeclaredOnly | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.SetProperty, null, item, new @object[] { 0 });
Question by:wenyonk
    LVL 48

    Expert Comment

    Did you try this without @ ?

    Author Comment

    no isn't object a C# reserved keyword??
    LVL 48

    Accepted Solution

    Yes, this is C# keyword, alias for Object. So, what about removing @ sign?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now