CAN I ASSIGN VALUES FROM MY COLLECTION IN A STRING ARRAY..?? (C#)

Jayden Bell

Total Post:110

Points:774
Posted by  Jayden Bell
 1379  View(s)
Ratings:
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! 

  1. AVADHESH PATEL

    Post:604

    Points:4228
    Re: Can I assign values from my collection in a string array..?? (c#)

    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);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!