So which line is causing the problem???
I'm *guessing* (since you didn't tell us) that it is the line
memberItem.ID = dr.GetInt32(0);
And that presumably means that the value in the database for that field (field zero) is not a valid integer.
Could be that the value in the DB is NULL. Could be that the value in the DB isn't an integer at all (e.g., could be a text field of some kind with values such as 'A17').
So... Time to go look carefully at your SQL query (the query that got you the DataReader) and then at the data in the DB.
|