MySqlException on ExecuteReader by Selecting UserID(PK)

Viewed 557

I try to Delete a Row from the Database on the phpAdmin the Query is working fine, but when I execute it with the

Code:

MySqlCommand getUserID = new MySqlCommand("SELECT UserID FROM User", connection);

MySqlDataReader reader = getUserID.ExecuteReader();

I get the

Error:

Destination array is not long enough to copy all the items in the collection. Check array index and length.

I Insert the to deleting user before without any trouble.

The Database has an UserID with properties Unique,Int(Length 9) and Auto-Increment and a UserName from type Char.

My Question is:

Why I can't receive the userID and how can I receive it ?

Edit

I can't receive any integer or date data only varchar.

Here is the Database creation query: Creation Query

3 Answers
Related