{%Pragmatic Coding%} Tips and tricks for software developers.


Canonical Function “EntityFunctions.TruncateTime” does not exist in MYSQL

In our project we are using CodeFirst EF and MySQL database. And I had to make some queries that excludes time from comparison. But when I tried to use "EntityFunctions.TruncateTime" function as I could use it with regular LINQ and MS SQL I've got an error {"FUNCTION [database].TruncateTime does not exist"}.

While researching network I found that EF v.4 and upper should support this function, but unfortunately it does not work for me, so I have found best solution is to create custom function for MySQL:

And now you can simply use it in your code:

Hope this article was helpful.

Tagged as: C#, mysql, sql No Comments

How To BackUp and Restore MySql Database

Hello dear reader!
I will give you simple ways how to restore and backup you MySql database with Command line and PHPMyAdmin.

1. Command Line. Backup Database.

Why we may want to back up or restore database from command line?
It is because PHPMyAdmin can't handle large databases. In that case straight mysql code and command line will help.
Read the full article...

Tagged as: mysql Continue reading