مرجع تخصصی برنامه نویسان

انجمن تخصصی برنامه نویسان فارسی زبان

کاربر سایت

saeedkabiri

عضویت از 1396/02/09

مشکل در بارگذاری وب سایت

  • پنجشنبه 18 مرداد 1397
  • 18:30
تشکر میکنم

سایتم بصورت DB First  نوشتم 

بعد بارگذاری پروژه  در هاست ،آدرس سایت وارد میکنم 

خطای زیر نمایش می دهد

The context is being used in Code First mode with code that was generated from an EDMX file for either Database First or Model First development.  This will not work correctly. To fix this problem do not remove the line of code that throws this exception. If you wish to use Database First or Model First, then make sure that the Entity Framework connection string is included in the app.config or web.config of the start-up project. If you are creating your own DbConnection, then make sure that it is an EntityConnection and not some other type of DbConnection, and that you pass it to one of the base DbContext constructors that take a DbConnection. To learn more about Code First, Database First, and Model First see the Entity Framework documentation here: http://go.microsoft.com/fwlink/?LinkId=394715

وب کانفیگ :

<connectionStrings>
    <add name="DBMyWebsiteEntities" connectionString="Data Source=*********;Initial Catalog=db_saeedkabiri_ir;User ID=****;password=****" providerName="System.Data.SqlClient" />
  </connectionStrings>

چطور میتونم مشکل بر طرف کنم؟

پاسخ های این پرسش

تعداد پاسخ ها : 1 پاسخ
کاربر سایت

ایمان مدائنی

عضویت از 1392/01/20

  • پنجشنبه 18 مرداد 1397
  • 19:33

رشته اتصالتون درست نیست 

نمونه زیر رو ببینید 

  <connectionStrings>
    <add name="Company_DBEntities" connectionString="metadata=res://*/Context.BarnamenevisanModel.csdl|res://*/Context.BarnamenevisanModel.ssdl|res://*/Context.BarnamenevisanModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=.;initial catalog=Company_DB;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

کاربرانی که از این پست تشکر کرده اند

هیچ کاربری تا کنون از این پست تشکر نکرده است

اگر نیاز به یک مشاور در زمینه طراحی سایت ، برنامه نویسی و بازاریابی الکترونیکی دارید

با ما تماس بگیرید تا در این مسیر همراهتان باشیم :)