1
I have a form, and in it I make a query in the database:
private void Consulta()
{
var dataCom = Convert.ToDateTime(label1.Text).ToShortDateString();
var conf = $"select * from data where data_venc = '{Datacom}'";
var comando = new MySqlCommand(conf, conn);
conn.Open();
var retorno = Convert.ToInt32(comando.ExecuteScalar());
conn.Close();
}
The variable Datacom
receives the current system date.
In the database I have two dates (registration date and due date), when registering user, add 30 days and save as due date.
I want to check if the due date is equal to the system, if it is, save the names of users in a variable (or whatever the type) so I can use later.
After storing these names of these variables, I want to take each name to send emails each with your name.
How can I do that?
good, but if I store several names in a variable I can utilazar these names separately to send an email to each names of those separated?
– Junior Quaresma Gutekoski
@Juniorquaresmagutekoski, yes you just create a List<T> or Array, in the case you prefer. Then go through this created object which in this case is a list or an array and do the individual processing for each name that is on that object. Then just fire the e-mails
– Diego Farias
@Juniorquaresmagutekoski Hello, consider accepting my answer if it has been useful to you. If you think she’s incomplete or doesn’t respond to you, make the appropriate comments so I can improve her.
– Ismael