SyntaxFix
Write A Post
Hire A Developer
Questions
Call ToString() instead of casting the reader result.
ToString()
reader[0].ToString(); reader[1].ToString(); // etc...
And if you want to fetch specific data type values (int in your case) try the following:
int
reader.GetInt32(index);