bltoolkit icon indicating copy to clipboard operation
bltoolkit copied to clipboard

"The given key was not present in the dictionary" in BLToolKit.4

Open ChandraMaurya opened this issue 12 years ago • 1 comments

I am getting this error with the latest binary. ".4". "The given key was not present in the dictionary."

I am using web.config connection string..

## And getting error on

using (DbManager db = new DbManager("DemoConnection"))

Error:

System.Collections.Generic.KeyNotFoundException was unhandled by user code HResult=-2146232969 Message=The given key was not present in the dictionary. Source=mscorlib StackTrace: at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at BLToolkit.Data.DbManager.GetDataProvider(String configurationString) at BLToolkit.Data.DbManager..ctor(String configurationString)

ChandraMaurya avatar Oct 22 '13 05:10 ChandraMaurya

Hello, @ChandraMaurya !

A long time ago you've asked this question)) And here is an answer: you should use appSettings, and not the connectionStrings in your web.config for BlToolkit. Yes, it looks awkward, but it is true. Be careful: you should pay attention for the name of your appSetting.

All details are here: http://stackoverflow.com/a/38081026/1115187

maxkoryukov avatar Jun 28 '16 16:06 maxkoryukov