Connection String Trouble MetaDataException

后端 未结 1 917
情书的邮戳
情书的邮戳 2020-12-22 01:21

I got two models in my project. When I added the second models I got this error in all account page:

System.Data.MetadataException: The specified schema is          


        
相关标签:
1条回答
  • 2020-12-22 01:48

    This looks like it's related to this problem:

    http://forums.devart.com/viewtopic.php?t=21488

    This article recommends two approaches. 1.Disable Conventions (I wouldn't recommend this) 2.Use OracleEntityProviderConfig to configure Workarounds.IgnoreSchemaName = true

    They also mention using a specific DbContext Template, which you can find from this article (I hate just posting links, but there's way too much information there to summarize):

    http://blog.devart.com/entity-developer-ef-code-first-dbcontext-template.html

    However, this was written for EF 4.1, and you don't say what version of EF you're using... so i'm not sure if any of this still applies to whatever version you may be using.

    So the gist is that you can't just replace the provider with no other changes. You're going to have to make some other changes, and I would suggest generating code with the DevArt DbContext template using similar code and see what it produces, then put that code in your app.

    Also, your code is obviously wrong. You're using connection strings that don't exist (You say the the connection string is called Entities, but your code is using a connection string called EntitiesMAE), you also say your second context is called UserContext, but your code is called EntitiesMAE. I suggest cleaning up your code so that it has your REAL code, because otherwise we're just trying to help you with code that isn't valid.

    0 讨论(0)
提交回复
热议问题