This item was migrated from the DevDiv work item tracking system [ID=7992]. <br />
Comments: Using opened connection would be very useful when using EF with System.Data.SQLite. This provider have a function "SetPassword" which allow to open encrypted database without putting the password into the connection string. This must to be call before Open(). I have found no way to use this function outside or inside my DbContext. The only way is to include the password into the connection string. I've tried to use SetPassword: - before the DbContext constructor: fail - after on mySQLiteConnection object: fail - after on dbContext.Database.Connection: fail One thing could work, I need a callback (event) on the DbContext when EF open the connection (OnBeforeOpen) so I could call SetPassword here. Thanks.
Comments: Using opened connection would be very useful when using EF with System.Data.SQLite. This provider have a function "SetPassword" which allow to open encrypted database without putting the password into the connection string. This must to be call before Open(). I have found no way to use this function outside or inside my DbContext. The only way is to include the password into the connection string. I've tried to use SetPassword: - before the DbContext constructor: fail - after on mySQLiteConnection object: fail - after on dbContext.Database.Connection: fail One thing could work, I need a callback (event) on the DbContext when EF open the connection (OnBeforeOpen) so I could call SetPassword here. Thanks.