Why, I wonder are you doing that?
public DateTime CurrentDateTime
{
get
{
return DateTime.Now.ToString(dd/MM/yyyy HH:mm:ss);
}
}
Since you want a DateTime value, why are you converting it to a string and returning that?
That code won't even compile - you will get a "Cannot implicitly convert type 'string' to 'System.DateTime'" error.
So, lets ignore that and look at what you are doing that is even worse...
Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.
The only reason you get an error is because you are converting a DateTime to a string and passing that string to SQL, which is converting it back to a DateTime, and failing - because it is expecting a different format. Now, you could "fix" that by converting the DateTime to an ISO DateTime format, but that would leave the rest of your code vulnerable to anyone you want's to type destructive things in...
Use Parameterized queries throughout, and you can pass the DateTime as a DateTime, no conversion is needed. And your database becomes less at risk...