When i run my MVC(C#,use entity Framework+MySql) project, it show that:There is already an open DataReader associated with this Connection which must be closed first. And the error code is:
[assembly: EdmRelationshipAttribute("blogModel", "cid", "cls", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(blog.Models.cls), "news", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(blog.Models.news), true)] [assembly: EdmRelationshipAttribute("blogModel", "uid", "users", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(blog.Models.users), "news", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(blog.Models.news), true)]
[XmlIgnoreAttribute()] [SoapIgnoreAttribute()] [DataMemberAttribute()] [EdmRelationshipNavigationPropertyAttribute("blogModel", "cid", "cls")] public cls cls { get { return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<cls>("blogModel.cid", "cls").Value; } set { ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<cls>("blogModel.cid", "cls").Value = value; } }
THis code is in the model file xx.Designer.cs,I want to know how to end the GetRelateReference or close DataReader, there no DataReader in xx.Designer.cs. and when i add MultipleActiveResultSets=true to connection string in web.config, i try again, it show me: The format of the initialization string does not meet specifications, how i can fix this problem?