-
March 12th, 2009, 12:59 AM
#1
net 3.5 ToArray() looking for code equivalent
Hello,
i have working code in net 3.5 that uses lumen framworks CSV reader and it works great!
however, for distribution purposes, i want to go back to net 2.0.
apparantly the only thing keeping me at net 3.5 is the ToArray() function which is a net 3.5 thing......
this converts the IEnumerable to string [][] array
Code:
StreamReader objStreamReader = new StreamReader(openFileDialog1.FileName);
CachedCsvReader csv;
if (openFileDialog1.FilterIndex == 2)//txt (Tab Delimited)
{
csv = new CachedCsvReader(new StringReader(objStreamReader.ReadToEnd()), true, '\t');
}
else
{
csv = new CachedCsvReader(new StringReader(objStreamReader.ReadToEnd()), true);
}
if (csv != null)
{
CSVData = csv.ToArray();
blah blah parse and place in datasource now....
CSVData is defined as follows
Code:
public string[][] CSVData = null;
what other methods can i use to convert the IEnumerate (string) to the string[][] array without ToArray() and keeping in net 2.0???
thanks!!
-
March 12th, 2009, 01:06 AM
#2
Re: net 3.5 ToArray() looking for code equivalent
It's hard to say without knowing the definition of CachedCsvReader. I found a class similar to that, but with no ToArray method. Instead of possibly wasting time with that, could you just post the source? You should look at how the class stores it's data internally to get a clue.
-
March 12th, 2009, 01:14 PM
#3
Re: net 3.5 ToArray() looking for code equivalent
hey thanks for the reply again!!
its a huge framework...
actually its a very nice peice of code
its lumen framework cached CSV reader...
which has an MIT open license, so you can use as you wish commercially too.
i was hoping there was an equivalent net 2.0 function, but judging by your response looke like id need a loop implementation which is not what i wanted to do...
ill just stick with net 3.5 then
thanks!!
p.s. youve helped me out twice now... one more time and ill have to pay you hahahah
-
March 12th, 2009, 01:20 PM
#4
Re: net 3.5 ToArray() looking for code equivalent
No, no payment required . You can however upvote my reply if you with (the little scale in the top right of a post).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|