ALTER Proc LoadLookupData As Select KeyName,KeyValue From Lookup Order By KeyName ALTER Proc LoadSysparms As Select KeyName,KeyValue From Sysparms Order By KeyNamethe structure for both tables is
KeyName varchar(100) not null KeyValue varchar(500) not nullThe problem I have , is , whenever I try to lookup a key value in the Dictionary populated by the SysParms table I receive a "Key not present in Dictionary" error, on closer inspection of the said Dictionaries I find: the one populated by the "Lookup" table has all of it's "Keys" trimmed whilst the other "SysParms" doesn't ! if I manually trim the "Keys" on creation of the rogue dict it works fine. I am at a loss as to why this is happening to one and not the other , my code for populating the dicts is shown below ( please trust me the DataSets are fine )
// SysMessages and SysParms are created further up the class. static void LoadLookupData() { DataSet ds = GetDataSet("LoadLookupData",true); foreach (DataRow dr in ds.Tables[0].Rows) SysMessages.Add(dr["KeyName"].ToString(), dr["KeyValue"].ToString()); } static void LoadSysParms() { DataSet ds = GetDataSet("LoadSysParms", true); foreach (DataRow dr in ds.Tables[0].Rows) SysParms.Add(dr["KeyName"].ToString(), dr["KeyValue"].ToString()); }as always any help appreciated