Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Code as follows

In Gridview as follows
Class   Batchno  Rate

AFF     B101     70
MFA     B102     60
ROC     B103     50


From Gridview i am displayed into chart using asp.net in CSharp.for that code as follows
C#
string[] LClass = new string[GridView3.Rows.Count];
string[] LRate = new string[GridView3.Rows.Count];
for (int icount = 0; icount <= GridView3.Rows.Count; icount++)
{
    LClass[icount] = GridView3.Rows[icount].Cells[0].Text.ToString();
    LRate[icount] = GridView3.Rows[icount].Cells[2].Text.ToString();
    Chart1.Series.Add(LClass[icount].ToString());
}


when i execute the error shows as follows

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index


please help me what is the problem in my code
Posted
Updated 29-Sep-13 23:30pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900