Uploading Files into Database with ASP.NET MVC

You could use a byte[] on your model and a HttpPostedFileBase on your view model. For example: public class MyViewModel { [Required] public HttpPostedFileBase File { get; set; } } and then: public class HomeController: Controller { public ActionResult Index() { var model = new MyViewModel(); return View(model); } [HttpPost] public ActionResult Index(MyViewModel model) { … Read more

Scaffolding controller doesn’t work with visual studio 2013 update 2

Hey for all of you that nothing works, the real answer is you need to remove ANYTHING that has a configSource on the web.config and the connection string needs to be inlined. EDIT: Someone pointed out that it needs to be only <configSettings>, <appSettings>, and <connectionStrings> tags NOT using a configSource attribute. And that he … Read more

“There was an error running the selected code generator” in VS 2013 scaffolding

VS2013 Error: There was an error running the selected code generator: ‘ A configuration for type ‘SolutionName.Model.SalesOrder’ has already been added …’ I had this problem while working through a Pluralsight Course “Parent-Child Data with EF, MVC, Knockout, Ajax, and Validation”. I was trying to add a New Scaffolded Item using the template MVC 5 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)