Closed talley closed 2 years ago
I believe you need to change your compiler type depending on what you are using. In my case I changed MySqlCompiler to SqlServerCompiler.
{
SqlConnection sqlcon = new SqlConnection(CONN_STR);
var compiler = new SqlServerCompiler();
var db = new QueryFactory(sqlcon, compiler);
var users = db.Query("Users2").Get<Users2>(); //error occurred here
return users.ToList();
}
as per @digitaldirk your connection and compiler should match, you are using SqlConnection (for SqlServer) and using MySqlCompiler (for MySql)
SqlConnection -> SqlServerCompiler MySqlConnection -> MySqlCompiler
Thank you. I don`t know how i missed this.