I am new to Dapper. I am trying to create a new project and display the local Dapper database. Unfortunately, I always get this error:
Failed to load type 'Dapper.SqlMapper' from the assembly 'Dapper, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null'
I added Dapper from NuGet (Dapper v. 1.39.0.0). This is an example of my code:
public static IEnumerable<TBMobileDetails> Allmobilelisting() { SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=""c:\users\database.mdf"";Integrated Security=True"); string query = "select * from Mobiledata"; var result = con.Query<TBMobileDetails>(query); return result; }
Where is the problem?
source share