Hi Team
My save functionality is getting this exception, before all my form fields were saving to my table on DB. 
- // Controller
- public ActionResult SubmitRegDetails(RegViewAndRoleViewModel eNtsaRegistration)
- {
- if(ModelState.IsValid)
- {
- eNtsaRegistration.RegForm.Id = Guid.NewGuid();
- db.eNtsaRegForms.Add(eNtsaRegistration.RegForm);
- db.SaveChanges(); // Throws error here each time want to save changes to DB.
- return RedirectToAction("SaveRegForm");
- }
- // Model
- public class eNtsaRegForm
- {
- [Key]
- public Guid? Id { get; set; }
- public string Title { get; set; }
- public string FirstName { get; set; }
- public string LastName { get; set; }
- public string Position { get; set; }
- public string Company { get; set; }
- public string StreetAddress { get; set; }
- public string StreetAddressLine { get; set; }
- public string City { get; set; }
- public string StateProvince { get; set; }
- public int ZipCode { get; set; }
- public string Country { get; set; }
- [Required(ErrorMessage = " This field is required")]
- [EmailAddress(ErrorMessage = "Invalid email address")]
- public string Email { get; set; }
- public int CellNumber { get; set; }
- public string DietaryRequirements { get; set; }
- }

Jenith ThakkarRank #789 · 2.9K reputationPosted Jul 23, 2020, 12:06 AM EDT
This error is generated when passed data length is greater then field length
Thank you
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Jul 22, 2020, 5:22 PM EDT
Guest UserRank #877 · 2.5K reputationPosted Jul 22, 2020, 11:25 PM EDT
Laxmidhar SahooRank #383 · 6.6K reputationPosted Jul 22, 2020, 11:58 PM EDT
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Jul 22, 2020, 11:58 PM EDT
Guest UserRank #877 · 2.5K reputationPosted Jul 23, 2020, 12:28 AM EDT
Santhakumar MunuswamyRank #128 · 17.3K reputationPosted Jul 23, 2020, 12:42 AM EDT