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

I created aboutcodes data base having reportcard table as show below

created GridView as show below

Here DataKeyNames name is idnumber

Problem 1:
Forget to add DataKeyNames name in GridView

GridView must contain DataKeyNames name

Problem 2:
Different DataKeyNames name

DataField name Must be one of column name of datbase table 

Problem 3:
Forget to add DataKeyNames column in Gridview column

DataKeyNames name column must be present in GridView column

Leave reply

Add your comments here

Back to Top