markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 303 forks source link

No System.Data.SqlClient Provider found. #337

Closed john-qin closed 10 years ago

john-qin commented 10 years ago

I kept getting this error message. not sure where the problem is.

    public class MappingRepository
    {
        private readonly dynamic _db = Database.OpenNamedConnection("CNFIRConn");

        public Mapping GetMapping(string profitCenter)
        {
            return _db.Mapping.FindAll(_db.Mapping.ProfitCenter == profitCenter).FirstOrDefault();
        }
    }
  <connectionStrings>
    <add name="CNFIRConn" connectionString="Data Source=localhost;Initial Catalog=test;Integrated Security=True" providerName="System.Data.SqlClient" />

  </connectionStrings>
john-qin commented 10 years ago

fixed myself, just need to install the provider.