I am using ADO.NET Entity Framework.
i have a table Employee which have the following fields.
- ID int (primary key)
- Name varchar(10) not null
- Email varchar(30) Null
here is the code
EmployeeEnitites e = new EmployeeEnitites();
Employee record = new Employee();
record.Name = "this is my test name.........."; // This produce the error because its MaxLength set to 10 in (CSDL)
e.SaveChanges(); // here i got the error "string or binary data would be truncated"
i want to make automatic Length and Required Field validation in the Entity Framework.
Is there any way? Please help regarding this issue
View Complete Post