KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a controller: [HttpPost] public ActionResult Create(Auction auction) { var db = new EbuyDataContext(); db.Auctions.Add(auction); db.SaveChanges(); return View(auction); } A model: public class Auction { public long Id { get; set; } public string Title { get; set; } public string Description { get; set; } public decimal StartPrice { get; set; } public decimal CurrentPrice { get; set; } public DateTime StartTime { get; set; } public DateTime EndTime { get; set; }} } And a view: @model Ebuy.Website.Models.Auction @using (Html.BeginForm()) { <p> //All the information fields... @Html.LabelFor(model => model.EndTime) @Html.EditorFor(model => model.EndTime) </p> } When I try to run it I receive the error: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The model-controller-view is from a book copied one-to-one. What is the format that I need to enter to the EndTime field so I won't have this error?
Tags (comma-separated)
Save Edits
Cancel