<connectionStrings> <add name="ComicContextDb" connectionString="Data Source=|DataDirectory|\Database1.sdf" providerName="System.Data.SqlServerCe.4.0"/> <entityFramework> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" /> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> controller.cs private ComicContext database = new ComicContext("ComicContextDb"); [HttpPost] public ActionResult RSVPForm(GuestResponse from) { database.Database1.Add(from); database.SaveChanges(); return Content("New comic added."); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)