Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Hessam #1
Cannot create an object of type 'System.String[]' from its representation 'String[] Array'
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 Guest
-
Object of type 'System.String' cannot be converted to type 'System
I'm trying to get a control from metabuilders.com dual list)to work under ASP.NET 2.0. It worked find under 1.1 and then when i migrated my... -
Cannot serialize object of type System.Object[,]. Multidimensional arrays are not supported
Hi, I get this on server when trying to retun a 2 dim array. I apprecaite that they are not supported as per... -
Cast from type 'Field' to type 'String'
Hi, Getting the above error - further info shown below Line 36: II2 = 0 Line 37: response.write ("var questions" & II & " = new Array();"... -
How to create an array from a string?
Hello. I would like to create an array from a string. I tried with: --------------------------- $string = "1 2 3"; @array1 = ; @array2 =... -
Cast from type 'DBNull' to type 'String' is not valid error
Trying to add an insert button Sub btnAddRow_Click event for adding a row to the datagrid and dataset back to SQL. Had it working per the... -
Hessam #2
Cannot create an object of type 'System.String[]' from its representation 'String[] Array'
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 Guest
-
Teemu Keiski #3
Re: Cannot create an object of type 'System.String[]' from its representation 'String[] Array'
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
[url]http://www.mansoft.fi[/url]
AspInsiders Member, [url]www.aspinsiders.com[/url]
ASP.NET Forums Moderator, [url]www.asp.net[/url]
AspAlliance Columnist, [url]www.aspalliance.com[/url]
"Hessam" <hessammehr@msn.com> wrote in message
news:OZMmfgYXDHA.1888@TK2MSFTNGP10.phx.gbl...an> Hello,
> I am designing a .net custom control in VS.net 7.1 and my control exposeshave> array of strings which are supposed to be the items to show. To do thisI> 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 whenerror.> 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> What should I do.
>
>
>
>
>
>
Teemu Keiski Guest



Reply With Quote

