Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
normal config:
<?xml version="1.0" encoding="utf-8"?>

<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add    name="Entities"  connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=00.000.00.0000;initial catalog=some;persist security info=True;user id=adm;password=pwd; multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
  </entityFramework>
</configuration>


encryptied config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
        <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"
            xmlns="http://www.w3.org/2001/04/xmlenc#">
            <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc" />
            <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
                    <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
                    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                        <KeyName>Rsa Key</KeyName>
                    </KeyInfo>
                    <CipherData>
                        <CipherValue>F0pnLcQkS/0q1OAIlDXECiIKqF7Tjd3498FN11noK8nJMoYVIAUtCQBzMbBKzj6XeUw3y5FrrvVPReZ/ek9RhD4f8gR0ZmwXAG48WthR9cbTzx9l5YPHwN8hpWCb3D+v9SJr5AK7EKcoJdDFFpR31MxOgFL6AeQSvuk3znFE+aQ=</CipherValue>
                    </CipherData>
                </EncryptedKey>
            </KeyInfo>
            <CipherData>
                <CipherValue>rGpHFMOj39D+2/ADNQ1xNPARGoq1XYPM4rCmvmSLM/o=</CipherValue>
            </CipherData>
        </EncryptedData>
    </connectionStrings>
</configuration>


What I have tried:

using System;
using System.ComponentModel;
using System.Data.EntityClient;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.Configuration;
using System.Security;
using System.Security.Cryptography; 

[assembly: EdmSchemaAttribute()]
namespace SMTAdapter
{
 
    
    /// <summary>
    
    /// </summary>
    /// 
    
    public partial class bankEntities : ObjectContext
    {
        #region Конструкторы
    
        public Entities() : base("name=Entities", "Entities")   <===this string produces error:name connectionString not found, not supposed to work with EntityClient or impossible
        {
            
            
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
Posted
Updated 10-Jan-18 16:04pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900