CREATE TABLE permission denied in database "'Database Adı"

alattin (16999) 8 yıl önce sordu

Asp.Net MVC uygulaması sunucuya atıldığında aşağıdaki gibi hata veriyor:

Server Error in '/' Application.

CREATE TABLE permission denied in database ''Database Adı'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database ''Database Adı'.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 


[SqlException (0x80131904): CREATE TABLE permission denied in database 'Database Adı'.]

CREATE TABLE permission denied in database ''Database Adı'. hatasının çözümü nedir?

Toplam 1 cevap


alattin (16999) 8 yıl önce cevapladı

Asp.Net MVC uygulaması CREATE TABLE permission denied in database ''Database Adı'. hatası veriyorsa, SQL sunucu üzerinde tablo yaratılamıyor demektir.

SQL kullanıcısının, uygulamada bağlantı cümlesinde tanımlı, tablo yaratmaya yetkisi yok anlamına gelmektedir.

Eğer veritabanı manuel oluşturulmuşsa, o zaman Gobal.Asax dosyasına şu satır eklenerek MVC uygulamasının veritabanı yaratma denemesi engellenebilir: Bu satır Global.asax içindeki Application_Start metodu içine yetleştirilmelidir.

 System.Data.Entity.Database.SetInitializer<Sirket.Product.Proje.Models.DB>(null);