Views: 4.9K
Replies: 1
Archived
|
Repository Error message - Type Initializer threw an exception.Hello,
I was wondering if anyone has come across the following error message. I receive the error message, "The type initializer for 'xxxxx.Domain.Repository '1' threw an exception". The error occurs when I run the following code: var allLocations = db.TblProjectLocations.All(); When I test this locally (with a mdf database file), I don't receive this error message and everything works fine. This error started to occur when I began testing my code on the web server. Here's my connection string as it appears in the web.config: <add name="Project" providerName="System.Data.SqlClient" connectionString="Data Source=dbServer;Initial Catalog=DatabaseApps;Persist Security Info=True;User ID=userId;Password=secret"/> Any assistance would be greatly appreciated. Regards, Ryan Ryan Loughner, Dec 15, 2014
|
|
Reply 1Figured this out. The issue occurred because I fat-fingered the database password.
Ryan Loughner, Dec 15, 2014
|