My guess would be that the problem is that you declared
email
as an integer:
int i = 0, email = 0;
and are trying to assign a string to it:
email = myDataReader.GetValue(i).ToString();
This does not work and should be the cause of the error message.
You do not need the declaration and assignment of the
email
variable, just use:
list_emails.Add( myDataReader.GetValue(i).ToString() );
Also I would like to note that the statement
i = i + 1 - 1;
has no effect and it is the same as
i = i;
, so this entire line could be omitted.
As the reader only has one column you are retrieving there is also no need to declare and use the
i
variable, so the statement to add the e-mail to the list becomes:
list_emails.Add( myDataReader.GetValue( 0 ).ToString() );