entity framework - EntityFramework 6.1 cannot connect -


I have an orbit library which I have been using for more than a year, which recently upgraded to EF 6.1 After the work has stopped working.

I have tried various types of ways to pass my context class constructor in the connect string, but when I correctly pass the string, I always get:

'(((System.Data.Entity.dibcontext) (reference) .database. Connection) .ServerVersion' type 'system threw an exception. Unknown Operation Exception '

and the connection state remains closed.

Here's my AppConfig:

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; Configuration & gt; & Lt; ConfigSections & gt; & Lt; Section name = "Antennaframework" type = "system.data.intninal.configfile.entitieframeworksite, entity framework, version = 6.0.0.0, culture = neutral, public keycon = b77a5c 561934a090" expectedprimation = "wrong" /> & Lt ;! - For more information about entity framework configurations, go to http://go.microsoft.com/fwlink/?LinkID=237468 - & gt; & Lt; / ConfigSections & gt; Visit & Lt; Startup & gt; & Lt; Supported serial version = "v4.0" sku = ".NETFramework, version = v4.0" /> & Lt; / Startup & gt; & Lt; ConnectionStrings & gt; & Lt; Add name = "MyContext" connectionString = "data source = server; initial catalog = DBName; integrated security = true; multiple active serialsets = true" provider name = "system.data. SQL client" /> & Lt; / ConnectionStrings & gt; & Lt; EntityFramework & gt; & Lt; Providers & gt; & Lt; Provider invarianatName = "System.Data.SqlClient" type = "System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> & Lt; / Providers & gt; & Lt; / EntityFramework & gt; & Lt; / Configuration & gt;   

My test class:

  using System.Data.Entity; Namespace SVMIC.IMS.INT.IMSClaim {Public Category Reference: DBCTXtex {Static Context (Database) • Database .set Inchylizer & lt; Context & gt; (Empty); } Public context (): base ("MyContext") {}}}   

and my test app:

  using the system; Using System.Collections.Generic; Using System.ComponentModel; Using System.Data; Using System.Drawing; Using System.Linq; Using System.Text; System usage threading. Task; Using System.Windows.Forms; Using SVMIC.IMS.Entity.IMSClaim; Namespace Testup {Public Partial Class} Form 1: Form {Public Form 1 () {Initialize Companent (); Reference Reference = New Context (); }}}   

Database server is SQL Server 2008 R2.

I think this has changed to a few simple 6.1 and I'm just remembering it, but I'm completely stumped.

OK, I have solved this problem.

Notwithstanding being able to fix this issue with 6.1 in desperation, nothing did I make any difference for the result, and even moving forward through the EF source And stepped up so that I brought it back in EF 5.0 and made my code again.

EF 5 returned an error message to identify a problem in the immediate schema definition, another viewer added that the referenced system view was confusing my template, Decided and working back in a matter of minutes.

Here's a lesson that AFF learned about some serious work on handling your error, because returning a normal exception error I had to follow in every direction, while error messages from EF 5 Pointed me directly to this issue.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -