Since
Text
is a valid property of many controls, and specifically of the TextBox and Label controls - which are the ones you probably want to use for this - and you don't tell us what the error message is, the best guess is many fold:
1) You don't have any control called txt_Date. Create one.
2) txt_Date is not a Label or TextBox. find out what it is.
3) You can't just assign a string value to a DateTime - that doesn't work any more than you can push a square peg into a round hole. You need to convert it to a DateTime value first, preferably with validation.
DateTime test;
if (!DateTime.TryParse(txt_Date.Text, out test))
{
... report input problem to user ...
return;
}
If you are using a DateTimePicker to select the date, then us the Value property, which is already a DateTime:
DateTime test = txt_Date.Value;
But change the damn name because that isn't a text based control...