The 'Sütun Adı' property on 'Tablo Adı' could not be set to a 'null' value hatası

0

C#, Asp.net MVC ile geliştirilen uygulama aşağıdaki hatayı veriyor:

System.Data.ConstraintException
  HResult=0x8013192A
  Message=The 'Sütun Adı' property on 'Tablo Adı' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'. 
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

The 'Sütun Adı' property on 'Tablo Adı' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.  hatasının çözümü nedir?

alattin alattin (16999)
5 yıl önce sordu

    Toplam 1 Cevap


    1

    The 'Sütun Adı' property on 'Tablo Adı' could not be set to a 'null' value. You must set this property to a non-null value of type 'System.Int32'.  hatasının çözümü nedir?

    Bu hatanın anlamı 'Tablo Adı' tablosundaki 'Sütun Adı' kolonu Int32 değer alması gerekiyorken NULL değer almış. Yani tablonuzda int türünde veri olması gereken bir sütuna siz veri girmemiş, boş bırakmışsınız. Böylelikle bu sütun NULL değerini almış.

    Bu sorun genelde mevcut bir veritabanındaki tabloya yeni bir int türüne sahip sütun eklediğinizde çıkar. Doğal olarak yeni eklenen sütun, tablo içinde veri varsa, null değerini alır.

    Çözüm olarak yeni eklediğiniz sütuna 0 verisini ekleyebilirsiniz. Burada amaç sütunu NULL değerinden kurtarmaktır. Elbette siz kendinize uygun olan veriyi yazmalısınız.

    alattin alattin (16999)
    5 yıl önce cevaplandı

      üyelik gerektirir

      Cevap yazabilmek için üye girişi yapmalısınız.

      Eğer uzmanim.net üyesiyseniz giriş yapabilirsiniz: üye girişi yap
      uzmanim.net'e üye olmak çok kolaydır: hemen kayıt ol