Question

I'm trying to create new application using BLToolkit but i can't compile the code, i get this error:

The type or namespace name 'DbManager' could not be found (are you missing a using directive or an assembly reference?

This class is described here

I included this References:

  • BLToolkit.4
  • BLToolkit.SL.4

But i don't see it, what is wrong?

Person GetPerson(int personId)
    {

        using (DbManager db = new DbManager())
        {
            return db
                    .SetCommand(@"
                     SELECT 
                         p.PersonId,
                         p.FirstName,
                         p.LastName,
                         p.MiddleName,
                         p.Gender
                     FROM Person p
                     WHERE p.PersonId = @PersonId",
                            db.Parameter("@PersonId", personId))
                    .ExecuteObject<Person>();
        }
    }

the same problem is with version 3

Was it helpful?

Solution

I just got it. It is the classical newbie error, BLToolkit that comes in binary files, is compiled under Framework 3.5, and my project was 4.0

There are two ways to solve this problem:

  • download source code project BLToolkit and include it to my project under FrameWork 4
  • or change configuration of current project to use FrameWork 3.5

issue solved

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top