Cannot create an object of type 'System.String[]' from its representation 'String[] Array'

Discussion in 'ASP .Net Building Controls' started by Hessam, Aug 8, 2003.

  1. Hessam

    Hessam Guest

    Hello,
    I am designing a .net custom control in VS.net 7.1 and my control exposes an
    array of strings which are supposed to be the items to show. To do this have
    declared a private string[ ] variable and a public property which returns
    it.
    string[] options = new string[1];

    public string[] Options

    {

    get

    {

    return options;

    }

    set

    {

    options = value;

    }

    }

    It works fine in the disigner and I can add items to the list using the
    VS.net string collection editor and see the changes in real-time. But when I
    run the App, I recieve this error:

    Cannot create an object of type 'System.String[]' from its string
    representation 'String[] Array' for the 'Options' property.

    Even with other types of collections (objects, etc.), I receive this error.
    What should I do.
    Hessam, Aug 8, 2003
    #1
    1. Advertising

  2. Hessam

    Teemu Keiski Guest

    If I remember right, there is kind of bug with exposing array types from
    designer. BTW: don't cross-post

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com

    "Hessam" <> wrote in message
    news:...
    > Hello,
    > I am designing a .net custom control in VS.net 7.1 and my control exposes

    an
    > array of strings which are supposed to be the items to show. To do this

    have
    > declared a private string[ ] variable and a public property which returns
    > it.
    > string[] options = new string[1];
    >
    > public string[] Options
    >
    > {
    >
    > get
    >
    > {
    >
    > return options;
    >
    > }
    >
    > set
    >
    > {
    >
    > options = value;
    >
    > }
    >
    > }
    >
    > It works fine in the disigner and I can add items to the list using the
    > VS.net string collection editor and see the changes in real-time. But when

    I
    > run the App, I recieve this error:
    >
    > Cannot create an object of type 'System.String[]' from its string
    > representation 'String[] Array' for the 'Options' property.
    >
    > Even with other types of collections (objects, etc.), I receive this

    error.
    > What should I do.
    >
    >
    >
    >
    >
    >
    Teemu Keiski, Aug 16, 2003
    #2
    1. Advertising

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. Hessam
    Replies:
    0
    Views:
    2,178
    Hessam
    Aug 8, 2003
  2. =?Utf-8?B?UmFqZXNoIHNvbmk=?=

    'System.String[]' from its string representation 'String[] Array'

    =?Utf-8?B?UmFqZXNoIHNvbmk=?=, May 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,801
    =?Utf-8?B?UmFqZXNoIHNvbmk=?=
    May 4, 2006
  3. Allan Ebdrup
    Replies:
    1
    Views:
    620
    Allan Ebdrup
    Jul 16, 2007
  4. Robert
    Replies:
    5
    Views:
    912
    阿利
    Apr 20, 2006
  5. Hessam
    Replies:
    0
    Views:
    267
    Hessam
    Aug 8, 2003
Loading...

Share This Page