This is simple.
SPSite site = new SPSite(http://server);
SPWeb myweb = site.OpenWeb();
SPUser found = myweb.AllUsers.GetByID(1);
This error came when i tried to access General Settings and other settings in the central administration. I used following code in the Power shell and get it worked.
$w = get-spwebapplication http://webapplication
(How to give permission to the BDC (Business Data Connectivity) Services)
This message occurs when the user doesn't have the sufficient permission for the BDC services.