MVC :: EF Design / "Entities In 'EntityContainer.ProductTypes' Error
Mar 23, 2011
I have two entities: Product and ProductType. I've generated a controller and views for both and can manage ProductTypes, however, when attempting to create a new Product, I get the error below:
"Entities in 'EntityContainer.ProductTypes' participate in the 'ProductProductType' relationship. 0 related 'Product' were found. 1 'Product' is expected."
the reason being that my view, as automatically generated, doesn't know about ProductType. how is this generally handled? I would like to display a listbox of product types on the product form and insert the right value.
I have a datamodel with a couple of tables. One of my tables have about 40 fields (I know that is a lot, but we have to keep the structure in place as we are upgrading a classic ASP project to MVC). Some of my Actions only updates 1 or 2 fields in my table.
Is there a way to create Entities, for instance, that only contains the contact details of the client table, and not any other details, and then another entity that contains only the address details. I don't want to submit the entire row when I only update telephone details, or the client's picture.
I'm working on a page that uses a master page. In the master page, I have a drop-down and when a value is selected I generate an evenIn the web page, I have this statement "Addhandler Master.FilterChanged, AddressOf FilterChangedFromMasterPage"Everything works fine, and can edit the page as much as I want, but only with the Source view - because if I look at the design view, the entire MainContent section is reduced to this error; "Error Creating Control- MainContent / Object Reference not set to an instance of an object"But if I debug it locally, or FTP it to the server, it works just fine!
We are starting a new web based product in which we are planning to expose our business logic through WCF services. We will be using ASP.NET 4.0, C#, EF 4.0. In future we want to build iphone applications and WPF applications based on the services. I have been reading a lot about using POCO vs Self Tracking Entities (STE) and from my understand the STEs do not work well with the web scenario.
When i use the query **var NewMatchs = (from x in entity.matches select x).LastOrDefault();** I got error like this **LINQ to Entities does not recognize the method 'SocialSports.Models.match LastOrDefault[match](System.Linq.IQueryable`1[SocialSports.Models.match])' method, and this method cannot be translated into a store expression.**
I'm trying to use a Tab control with 5 tabs inside a form view, when I view my aspx page in Visual Studio 2008 it displays a error message stating "There was an error rendering the control. Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "AjaxControlToolkit.properties.Resources.resources" was coreectly embedded or linked into assembly ... " running the site just shows a blank page (as the control isn't rendered).
If I remove the tab control from within the ItemTemplate (or EditItemTemplate) and put it directly onto the page it works fine. Googling for the error suggests the references aren't correct, so I've reset the toolbox, and re-added the reference - this time referencing the file in my Bin folder (not the installation path of the Ajax Toolkit). Still it throws the same error. Finally I've stripped the code out into a page with the bare minimum (no code behind) and it still throws the same error. I'm sure I had this working previously. I'm using Visual Studio 2008 on Windows 7 and I'm using the 3.5 files from Codeplex (AjaxControlToolkit.Binary.NET35.zip) targetting .NET Framework 3.5.
I'm receiving the following error in DesignMode with the Accordion1 control. Not sure what is causing this. This is my ASP WebApp.Error Rendering Control - Accordion1 An unhandled exception has occurred. Collection was modified; enumeration operation may not execute.Any idea, what causes this error?Code VS 2005 Pro ASP Ajax XP SP3
After I imported a VS 2008 web project to VS 2010, I can't view aspx pages that have master pages in design mode. The page design mode displays "error creating control - contentplacehoder1 object reference not set to an instance of an object." The project builds and runs fine though. I have only one master page that all other aspx pages reference and I don't have any nested master pages.
can't connect to sql 2005 express sp1 and vs is also sp1. 2) Which my guess is because of the database connection not being able... design view is not able to pull in the application for design, it's as if there is no theme and css just white background and black print.
I am creating an Asp.net web site which will support dynamic data. When I am creating a dynamic web site from Scratch (from template in VS) all is working fine. But when I am trying to add dynamic entity (.edmx) file and running the application I am getting following error
"The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'. "
I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.
Error: '<SomeValue>' Could not be set to '<SomeProperty>'
This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control will render fine in Design view. It's only when I set a value to a custom property.
Property Code Example:
I've even removed the Category and Description tags with no difference.
I don't know if what I said makes sens, but I hope it does.
I was referred here by MSDN forums hope this is the right place - I have a custom control (:WebControl) that renders web.sitemap in a specific way. While it runs error free and produces the expected result, at Design-Time it complains
and have tried the SiteMapDataProvider Tag with and without the SiteMapProvider attribute.Does anybody have (a) any experience with this, or (b) any suggestions as to how to track down the problem?
I'm about to design my Web service API, most of the functions of my API is basically very simular to my web application. Now the question is, should I create 1 single method and reuse them for both the web application and the web service api? (This seems to be the logical solution, however its very complicated; it's much easier to duplicate the method used by the web application, and keep both separate, ie one method for the web application and one method for the web service.)
1) REUSE: one main method and reuse them for both web application and web service application (I like this but it's complicated)
WebAppMethodX --uses--> COMMONFUNCTIONMETHOD_X APIMethodX ---uses----> COMMONFUNCTIONMETHOD_X ie Commonfunctionmethod_x contains reusable set of common features PRO: less code, less maintenance, less bugs. CON: very complicated
2) DUPLICATE: two methods, one method for the web application and one method for the web service.
WebAppMethodX APIMethodX PRO: simple CON: duplication = more code, more maintenance, more bugs!
Web service error response (code/message etc) would you store it in a database? or would you keep the error response in a method.By the time I'm done with this, there will be hundreds of error response, maybe in the future, thousands? (I dont know yet, depends how large this web service grows).EDIT: error response is the response returned back to the application via the web service, (not to be confused with error logging).