Getting Data From Application Object and C#

  • Thread starter Matthew Sajdera
  • Start date
M

Matthew Sajdera

All -

This probably qualifies for the "Stupid Question of the Day" award but I am
stuck on this.

I have an IIS Application object in which I am storing a multi-dimensional
array. Later on in the application I am trying to retrieve this array and
set it to a local array, but I cannot get the right syntax (and I may be
doing it wrong completely).

I'm dimming a local variable as:
string [,] strViewArray;

I am then trying to set this Array equal to Application["navigationViews"],
the array defined in the Application object. I keep getting a build error
that says I cannot implicitly set the string array to an object. I
understand this error but I cannot figure out how to get the object cleanly
out of the Application object and into the Array variable.

Any help is greatly appreciated.

Thanks,

- Matt
 
B

Bruno Sirianni

you can try :

string [,] strViewArray;
strViewArray = Application["...."] as string[,];

Brun
 
M

Matthew Sajdera

Bruno -

You are my best friend!

Thanks,

- Matt



Bruno Sirianni said:
you can try :

string [,] strViewArray;
strViewArray = Application["...."] as string[,];

Brun

Matthew Sajdera said:
All -

This probably qualifies for the "Stupid Question of the Day" award but I am
stuck on this.

I have an IIS Application object in which I am storing a multi-dimensional
array. Later on in the application I am trying to retrieve this array and
set it to a local array, but I cannot get the right syntax (and I may be
doing it wrong completely).

I'm dimming a local variable as:
string [,] strViewArray;

I am then trying to set this Array equal to Application["navigationViews"],
the array defined in the Application object. I keep getting a build error
that says I cannot implicitly set the string array to an object. I
understand this error but I cannot figure out how to get the object cleanly
out of the Application object and into the Array variable.

Any help is greatly appreciated.

Thanks,

- Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top