This Error occur when you load a connectionstring, or appsettings from within a Web Part. This error does not occur if you load the same config from within a MOSS application page, or from an aspx page. This issue is resolved by setting identify in web.config file from <identity impersonate=”true” /> to <identity impersonate=”false” />
To get a firm grasp of ASP.NET identify matrix, visit Microsoft Web Site at http://msdn.microsoft.com/en-us/library/aa302377.aspx