IDeltaVItem.Comment Property

IT Hit WebDAV for .NET

Tracks a brief comment about a resource that is suitable for presentation to a user.

[Visual Basic]
Property Comment As String
[C#]
string Comment {get; set;}

Property Value

Comment string.

Remarks

This property can be used to indicate why that version was created.

Example

public string Comment
{
    get
    {
        string comment;

        using (SqlConnection conn = new SqlConnection(fConnStr))
        {
            conn.Open();
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = "SELECT Comment FROM Version WHERE VersionId = @VersionId";
            cmd.Parameters.Add("@VersionId", SqlDbType.UniqueIdentifier).Value = VersionId;
            comment = (string)cmd.ExecuteScalar();
        }

        return comment;
    }
    set
    {
        using (SqlConnection conn = new SqlConnection(fConnStr))
        {
            conn.Open();
            SqlCommand cmd = conn.CreateCommand();
            cmd.CommandText = "UPDATE Version SET Comment = @Comment WHERE VersionId = @VersionId";

            cmd.Parameters.Add("@VersionId", SqlDbType.UniqueIdentifier).Value = this.fVersionId;
            cmd.Parameters.Add("@Comment", SqlDbType.NVarChar).Value = value;
            cmd.ExecuteNonQuery();
        }
    }
}
 

See Also

IDeltaVItem Interface | ITHit.WebDAV.Server.DeltaV Namespace