try
{
string LoginName = string.Empty;
string SiteUrl = SPContext.Current.Site.Url;
string Username = SPContext.Current.Web.CurrentUser.LoginName;
SPSite Site = new SPSite(SiteUrl);
string data = string.Empty;
using (SPWeb Web = Site.OpenWeb())
{
SPList List = Web.Lists["User Information List"];
SPQuery Query = new SPQuery();
Query.Query = "<Where><Eq><FieldRef Name = 'ID'/><Value Type='Text'>"+Username+"</Value></Eq></Where>";
SPListItemCollection ItemCollection;
ItemCollection = List.GetItems(Query);
if (ItemCollection.Count > 0)
{
foreach(SPListItem ListItem in ItemCollection)
{
if (ListItem["Picture"] != null)
{
data = ListItem["Picture"].ToString();
}
}
}
}
}
catch(Exception ex)
{
Context.Response.Output.Write("Error : " + ex.Message.ToString());
}