Today, I encountered a problem like this. type initializer for "Dbutility.dbhelpersql" throws an exception
The type initializer for "Dbutility.dbhelpersql" throws an exception
Maybe have and I meet this problem of people also in this problem how to solve, in not solve this problem I also with your now mood, also hundred spent, Goolge, but still did not solve, at this time we need to calm down to think about what will appear this problem
Analysis of the cause of the problem, and now I come to answer why this error, in fact, it is very simple that you do not configure the Web Connection database statement, in which to find the reason is right
public static readonly String connectionString = configurationmanager.appsettings["SQLConnString1"];
<add key= "projectconnectionstring" value= "Data source=monkey-pc\sqlexpress; Initial Catalog=kfdb; User Id=sa; password=123; " />
These two pieces of code are connected to the database bridge is also the cause of the error, configured to connect to the database