I use Visual Studio data classes designer to draw the model first and generate the database then. I want a field (boolean in the class, int in the table) to be non-nullable but optional to specify. How do I specify a default value?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Click on the field of interest in the dbml and select Properties and toggle Auto Generated Value. This will address the case when the created SQL field has a default value, e.g., “created DATETIME DEFAULT(GETUTCDATE()) NOT NULL”.
You can set the DEFAULT value using ALTER. How to do it graphically though I’m not certain.