ArrayList (Int16) to comma delim. string

Fithos

New Member
What is the easiest way for me to get a comma delimited string from an ArrayList filled with Int16's? <BR><BR>Example: <BR><BR>ArrayList myList = new ArrayList(); <BR>myList.Add((Int16)1); <BR>myList.Add((Int16)2; <BR>myList.Add((Int16)3; <BR>myList.Add((Int16)4; <BR>myList.Add((Int16)5; <BR><BR>And what I want is this "1, 2, 3, 4, 5" <BR><BR>I want to get a comma-delimited string so that I can use it for a sort on a data view <BR><BR>myDataView.Sort = "column In(" + commaDelimString + ")"; <BR><BR>Can anyone help? I have been going crazy one this one for hours now and I just can't get it figured out. I tried variations including, array.copyto, array.clone, arraylist.toarray, etc.... The only thing that I haven't done, becuase I was hoping there was a better way, is loop through the array of Int16's and populate an array of string's or a stringbuilder. <BR><BR>Thanks for any advice you might have.
 
Back
Top