Home > DeveloperSection > Forums > Can I assign values from my collection in a string array..?? (c#)
Jayden Bell
Jayden Bell

Total Post:105

Points:739
Posted on    May-03-2013 1:31 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 1059  View(s)
Rate this:
Hi Everyone!

I am trying to get values from name value collection and trying to store it in a string array

for (int i=0; i<arr.Length; i++)
{
    arr[i] = DataRowColl.GetValue[i];
}
DataRow.Coll is my namevaluecollection. Its giving the error that reference without parentheses, Can I assign values from my collection in a string array..??

Thanks in advance! 



AVADHESH PATEL

Total Post:604

Points:4228
Posted on    May-03-2013 9:09 AM

Hi Jayden!

GetValue is not a member of NameValueCollection. The function is called Get. If you want to use the [] operator, you don't have do call the Get function. So call

arr[i] = DataRowColl[i];
or:

arr[i] = DataRowColl.Get(i);

Don't want to miss updates? Please click the below button!

Follow MindStick