Error

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

Could not load file or assembly 'MySql.Data, Version=6.6.5.0 in vb.net

Error Could not load file or assembly 'MySql.Data, in Vb.net C#

Solution 1:-

1st you have to remove old MySql.Data from reference

Setps to remove reference

Website-> Start Option -> click on Reference Tab-> select MySql.Data and click on remove.

Now add new MySql.Data to reference

click here to know setps for adding reference

How to solve error cout undeclared and cin undeclared in Dev c++

If your using Dev c++ as compiler for c++ program but you getting following error.

`cin' undeclared (first use this function)
`cout' undeclared (first use this function)

Than use following statement after header files.

using namespace std;

see following example to get idea

#include
int main()
{
int num;
cin>> num;
cout << num; return 0; } modify this program by adding using namespace std; statement. #include
using namespace std;
int main()
{
int num;
cin>> num;
cout << num;
return 0;
}

Back to Top