I am learning MVC 4 from O'Reilly book (Programming ASP.NET MVC4) and have followed its steps so now have a class as:
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; }
//[Column(TypeName = "DateTime2")]
public DateTime StartTime { get; set; }
//[Column(TypeName = "DateTime2")]
public DateTime EndTime { get; set; }
}
and as you know better I have to go with EF (eh) and when I run the code I get and error as
The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated.
Yes, I know it is here on SOF and discussed but from the answers on SOF I found that i can do a conversion in the table. As you see I have commented out the attributes in the class since using them leads me to a new error as:
The model backing the 'eBayDataContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).
Beside this situation: I cannot see any DB or table made in SQL Server. How can I locate the table/DB generated by EF? I have checked but nothing I do see here!
This is my connectionString
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-eBay-20140404154307;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-eBay-20140404154307.mdf" providerName="System.Data.SqlClient" />
</connectionStrings>
Thank you.