views:

72

answers:

0

I am a newbie to ADO.net entity framework. I added 3 tables from the database and tried to query, base.CreateQuery gives exception "an item with the same key has already been added". Validate doesn't show any message either.

   FISSEntities SecurityMastercn = new FISSEntities(connectionString);
   var vwCadis = from cusip in SecurityMastercn.FI_CusipMaster 
                      select cusip;

Figured that problem is due to connection, getting this error System.Data.EntityClient.EntityConnection.get_ServerVersion().

 <add name="FISSEntities" connectionString="metadata=res://*/UDI.SecurityMasterEntities.csdl|res://*/UDI.SecurityMasterEntities.ssdl|res://*/UDI.SecurityMasterEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=wdb0153\sql3;Initial Catalog=FISS;User ID=acmdssuser;Password=Ac3W36U$3r;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

Where am I going wrong? Would appreciate any help on this.

related questions