i think you might be getting confused ;)
SPContext.Current.Web.ParentWeb.Url
is fine if you do:
SPContext.Current.Web.RootWeb.Url
root web is the web at the root level (top most level) of the site collection!
if its at root which i think your refering to??:
SPWeb web = SPContext.Current.Web.RootWeb
//you are now in the root parent spweb object
SPList list = web.Lists["MyCustomList"];
SPListItemCollection itemCol = list.Items;
foreach (SPListItem item in itemCol)
{
//do what you want with each item
}
the above code would work if you were to put the webpart on any site or subsite as its refering to the root site of all sites and subsites.
if your not happy with the code above than you can use:
String siteUrl = SPContext.Current.Web.Site.Url; //Featch the top site url
above also gets the root site url for that given sitecollection! eith use it as it is as it will give you the url or:
SPSite site = SPContext.Current.Web.Site;
using(SPWeb web = site.OpenWeb())
{
//you are now in the root parent spweb object
SPList list = web.Lists["MyCustomList"];
SPListItemCollection itemCol = list.Items;
foreach (SPListItem item in itemCol)
{
//do what you want with each item
}
}