I know this questions has been asked before, but previous answers doesn't seem to be relevant for my problem.
I periodically get the "The ConnectionString property has not been initialized." error. This is what the connection string looks like in web.config
<connectionStrings>
<add name="Dev" connectionString="Data Source=192.168.200.132,1445;Initial Catalog=Test;User Id=tester;Password=test123;Pooling=true" providerName="System.Data.SqlClient"/>
</connectionStrings>
I'm getting the connection string using
ConfigurationManager.ConnectionStrings["Dev"].ConnectionString
Here is the stacktrace
at System.Data.SqlClient.SqlConnection.PermissionDemand()
at System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Lite.Data.Database`2.CheckConnection()
at Lite.Data.Database`2.ExecuteReader(String sql, QueryParam[] args)
at Lite.Data.LiteQuery.Results()
I have a simple query builder. Results()
compiles the query and executes it using the database class.
Also, do you know why there's a "`2" after my database class name?
Thanks.