I have problem. I added new column into my db table. It is varchar(255) and it is nullable. When I added that column in my SQL query it throws error.
'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Function FROM Personnel' at line 1'
When I delete Function from query then it works fine. There isn't error in syntax.
public static IEnumerable<Personnel> GetPersonnel()
{
using (var connection = DatabaseManager.CreateConnection())
{
return connection.Query<Personnel>(@"SELECT Id, Name, Phone1, Phone2, Address, CIN, Salary, RoleId, Function FROM Personnel");
}
}
How to fix this? String can store null, where is problem?