जब इसईएफ के तहत डीबी डिफ़ॉल्ट मान कैसे सम्मिलित करें?
ContentContacts c2 = new ContentContacts();
c2.updated_user = c2.created_user = loggedUserId;
c2.created_date = c2.updated_date = DateTime.UtcNow;
db.ContentContacts.AddObject(c2);
की तरह एक नया रिकॉर्ड जोड़ने मैं
Cannot insert the value NULL into column 'main_email_support', table 'SQL2008R2.dbo.ContentContacts'; column does not allow nulls. INSERT fails. The statement has been terminated.
हो रही है, लेकिन डेटाबेस में डिफ़ॉल्ट मान की तरह कोई रिक्त स्ट्रिंग है:
क्यों क्या मुझे ऐसी त्रुटि मिल रही है? नहीं करना चाहिए एफई कहते हैं कुछ की तरह:
"ohh, it's a
null
value, so let's add the column default value instead"
क्या आपको AddObject लाइन में त्रुटि मिल रही है, या जब आप परिवर्तनों को सहेजते हैं? –
जब मैं 'सेव चेंज' कहता हूं तो त्रुटि आग लगती है – balexandre