User the following code to get username. The username is usually in "domain\\username" format. SPWeb oWeb = SPContext.Current.Web; SPUser sUser = oWeb.CurrentUser; string sUserName = sUser.LoginName Use the following method to remove extra slashes. public string getUserName(string strLogin) { string str = ""; // Parse the string to check if domain name is present. int idx = strLogin.IndexOf('\\'); if (idx == -1) { idx = strLogin.IndexOf('@'); } string strDomain; string strName; if (idx != -1) { strDomain = strLogin.Substring(0, idx); strName = strLogin.Substring(idx + 1); } else { strDomain = Environment.MachineName; strName = strLogin; } return strName; } } Check if it is working for you with or with out removing extra slashes. If you are looking for help with SPQuery let me know. -Susheel Dakoju
M
Member 3836567
@Member 3836567