0

I am using Entity Framework 6.1.3 along with SQL Server CE 4.0. Is there anyway to put a password on the generated sdf file the first time it is created?

 <connectionStrings>
    <add name="SQLCompactTest" connectionString="Data Source=|DataDirectory|SqlCeTest.sdf;Password=aaa;" providerName="System.Data.SqlServerCe.4.0" />
  </connectionStrings>

I try to add a Password field in my connection string but it does not add a password to the sdf file.

Thank you.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Frank Liu
  • 1,466
  • 3
  • 23
  • 36

1 Answers1

0

Adding a Password field in the connection string DOES add a password to the created sdf. You just have to make sure the connectionstring is used by entityframework, which tripped me over.

Frank Liu
  • 1,466
  • 3
  • 23
  • 36