Entity Framework Error: The field is required

SUJAYS
 
on Dec 27, 2018 10:54 PM
2632 Views

As i have created Entity framework the table have been selected but if i want to select multiple table the error is occuring.

https://imgur.com/a/205Cfze

Used below code to get the error

https://imgur.com/a/dDcnrbD

                   try
                   {
                       Reason lat = new Reason();
                       // TODO: Add insert logic here 
                       lat.Desc = Lat.Desc;
                       
                       Obj.Reasons.Add(lat);
                       Obj.SaveChanges();
                   }
                   catch (DbEntityValidationException ex)
                   {
                       foreach (var entityValidationErrors in ex.EntityValidationErrors)
                       {
                           foreach (var validationError in entityValidationErrors.ValidationErrors)
                           {
                               Response.Write("Property: " + validationError.PropertyName + " Error: " + validationError.ErrorMessage);
                           }
                       }
                   }
                   return "Reason Added Successfully";
               }

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download