Consider using a component for dates . That being said I'll try to give a solution to what seems to be what you need:
DateTime dataInicio;
if (!DateTime.TryParse(textbox_inicio.Text, out dataInicio)) {
lblErro.Text = "Formato da data inicial é inválido";
lblErro.Visible = true;
return;
}
DateTime dataFim;
if (!DateTime.TryParse(textbox_fim.Text, out dataFim)) {
lblErro.Text = "Formato da data final é inválido";
lblErro.Visible = true;
return;
}
if (DateTime.Compare(dataInicio.Date > dataFinal.Date) {
lblErro.Text = "Data inicial não pode ser superior à data final";
lblErro.Visible = true;
} else {
lblErro.Text = "";
lblErro.Visible = false;
}
I placed GitHub for future reference .
This is just a base, you can do better than this and you will probably need to adapt to what you need since you have not posted your code.