The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid. Hatası

Entity Framework kullanılırken yeni bir datamodel oluşturuyoruz. Ancak projemizi çalıştırınca
"The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid." hatası alıyoruz.

Bunun sebebi arkadaşlar EF nin bağlantı cümlesini sadece bir yere yani app.config dosyasına eklemiş olmasıdır. Fakat VS malesef bağlanmak için web config doyasına bakmaktadır. Bu durumda bağlantı cümlemizi aşağıda görüldüğü gibi web config dosyamıza taşımamız halinde tüm sorun çözülecektir.
Bu kodları system.web düğümünün üstüne yerleştiriyoruz.


  <connectionStrings>
    <add name="BilgiBankasiEntities" connectionString="metadata=res://*/BilgiBankasi.csdl|res://*/BilgiBankasi.ssdl|res://*/BilgiBankasi.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=OMP_COMPUTER;Initial Catalog=BilgiBankasi;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

Yorumlar

Bu blogdaki popüler yayınlar

Asp.Net ile Mernisten veri Çekme