Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Load file into string? Pin
Dominik Reichl8-Jun-04 4:14
Dominik Reichl8-Jun-04 4:14 
AnswerRe: Load file into string? Pin
Heath Stewart8-Jun-04 4:00
protectorHeath Stewart8-Jun-04 4:00 
GeneralRe: Load file into string? Pin
Dominik Reichl8-Jun-04 4:19
Dominik Reichl8-Jun-04 4:19 
GeneralRe: Load file into string? Pin
Heath Stewart8-Jun-04 4:22
protectorHeath Stewart8-Jun-04 4:22 
GeneralRe: Draw Shape To Screen Pin
SJ_Phoenix8-Jun-04 0:24
SJ_Phoenix8-Jun-04 0:24 
GeneralRe: Draw Shape To Screen [EDITED] Pin
Dave Kreskowiak8-Jun-04 3:17
mveDave Kreskowiak8-Jun-04 3:17 
GeneralConverting an array list to double array Pin
_Searcher_8-Jun-04 0:01
_Searcher_8-Jun-04 0:01 
GeneralRe: Converting an array list to double array Pin
Aryadip8-Jun-04 2:08
Aryadip8-Jun-04 2:08 
hi,

your question is not clear. I don't understand what exactly do you want...
Well here are the 2 possibilities that I can think of...

1st Possiblity :
If you require a specific Array of type object from the arraylist then you may use a similar code as below

string[] s = new string[10];
s[0] = "Aryadip";
ArrayList al = new ArrayList();
al.Add(s);
string[] ss = (string[])al[0];
MessageBox.Show( ss[0] );

2nd Possibility :

You require the full arraylist content in an array...in other words the array representation of the arraylist.
Now the complexity is the arraylist elements are arrays
Then the resulting array will be double dimentional...
The code to retrieve the same is :

string[] s = new string[10];
s[0] = "Aryadip";
ArrayList al = new ArrayList();
al.Add(s);
string[][] ss = (string[][])al.ToArray(s.GetType());
MessageBox.Show( ss[0][0] );

Now tips for your code :
DataReader is returning you an object array. After adding that object array to arraylist(like you did) you can get them back by using one of the methods mentioned above(replace string with object).

In the Individual object arrays that you add to the arraylist... if all the values are of type double then you can safely typecast with double array.

In case you are not sure or the object array contains values from different datatype then first obtain the object array by using one of the above methods and then use "Convert.ToDouble()" method to convert the specific array element to double value.Please refer to code below to get a better understanding...

object[] s = new object[10];
s[0] = "Aryadip";
ArrayList al = new ArrayList();
al.Add(s);
string[][] ss = (string[][])al.ToArray(new string[10].GetType());
MessageBox.Show( ss[0][0] );

Hope this helps you... if I have gone into wrong track... then sorry for that...

regards,
Aryadip.


Cheers !! and have a Funky day !!

GeneralRe: Converting an array list to double array Pin
_Searcher_8-Jun-04 3:59
_Searcher_8-Jun-04 3:59 
GeneralRe: Converting an array list to double array Pin
Heath Stewart8-Jun-04 3:56
protectorHeath Stewart8-Jun-04 3:56 
GeneralBanner in Help-Files? (How to?) Pin
Ariadne7-Jun-04 23:44
Ariadne7-Jun-04 23:44 
GeneralRe: Banner in Help-Files? (How to?) Pin
Heath Stewart8-Jun-04 3:52
protectorHeath Stewart8-Jun-04 3:52 
GeneralRe: Banner in Help-Files? (How to?) Pin
Ariadne8-Jun-04 21:14
Ariadne8-Jun-04 21:14 
GeneralRe: Banner in Help-Files? (How to?) Pin
Heath Stewart9-Jun-04 2:08
protectorHeath Stewart9-Jun-04 2:08 
GeneralGraphic drawing with OR transparency Pin
azusakt7-Jun-04 21:53
azusakt7-Jun-04 21:53 
GeneralRe: Graphic drawing with OR transparency Pin
Mazdak7-Jun-04 22:22
Mazdak7-Jun-04 22:22 
GeneralRe: Graphic drawing with OR transparency Pin
azusakt7-Jun-04 22:46
azusakt7-Jun-04 22:46 
GeneralRe: Graphic drawing with OR transparency Pin
Mazdak8-Jun-04 1:22
Mazdak8-Jun-04 1:22 
GeneralRe: Graphic drawing with OR transparency Pin
Dave Kreskowiak8-Jun-04 4:29
mveDave Kreskowiak8-Jun-04 4:29 
GeneralRe: Graphic drawing with OR transparency Pin
Jay Shankar9-Jun-04 22:45
Jay Shankar9-Jun-04 22:45 
GeneralDraw Shape To Screen Pin
Anonymous7-Jun-04 21:40
Anonymous7-Jun-04 21:40 
GeneralMDI Form Pin
kobystud7-Jun-04 21:20
kobystud7-Jun-04 21:20 
GeneralRe: MDI Form Pin
Dave Kreskowiak8-Jun-04 3:13
mveDave Kreskowiak8-Jun-04 3:13 
Generalsetup creation Pin
sreejith ss nair7-Jun-04 21:16
sreejith ss nair7-Jun-04 21:16 
General.NET Profiler Pin
Wizard_017-Jun-04 20:32
Wizard_017-Jun-04 20:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.