I have a form , and 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 (date of registration and expiration date), when making the user registration, I add 30 days and saved as the due date.
I want to check if the due date is the same as the system, if so, save the user names in a variable (or whatever the type) so that I can use it later.
After saving these names of these variables, I want to get each name to send emails each with their name.
How can I do this?