Share via


SPUser.Notes property

Gets or sets notes for the user.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Property Notes As String
    Get
    Set
'Usage
Dim instance As SPUser
Dim value As String

value = instance.Notes

instance.Notes = value
public string Notes { get; set; }

Property value

Type: System.String
A string that contains the notes.

Remarks

To modify the notes for a user by setting the value of the Notes property, call the Update method to effect the changes in the database.

Examples

The following code example modifies the notes for a specified user object.

Dim siteCollection As SPSite = SPControl.GetContextSite(Context)
Dim site As SPWeb = siteColl.AllWebs("Site_Name")
Dim user As SPUser = site.AllUsers("User_Name")

user.Notes = "User_Notes"

user.Update()
SPSite oSiteCollection = SPContext.Current.Site;
using(SPWeb oWebsite = oSiteCollection.AllWebs["Website_Name"])
{
    SPUser oUser = oWebsite.AllUsers["User_Name"];

    oUser.Email = " E-mail_Address";
    oUser.Name = " Display_Name";
    oUser.Notes = " User_Notes";
    oUser.Update();
}

Note

Certain objects implement the IDisposable interface, and you must avoid retaining these objects in memory after they are no longer needed. For information about good coding practices, see Disposing Objects.

See also

Reference

SPUser class

SPUser members

Microsoft.SharePoint namespace