Partager via


IDSRefProvider.SetName Method

Sets the name of a specified node.

Namespace:  Microsoft.VisualStudio.Data.Interop
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Sub SetName ( _
    drnidCurr As IntPtr, _
    bstrName As String _
)
void SetName(
    IntPtr drnidCurr,
    string bstrName
)
void SetName(
    [InAttribute] IntPtr drnidCurr, 
    [InAttribute] String^ bstrName
)
abstract SetName : 
        drnidCurr:IntPtr * 
        bstrName:string -> unit
function SetName(
    drnidCurr : IntPtr, 
    bstrName : String
)

Parameters

  • drnidCurr
    Type: System.IntPtr

    [in] DSREFNODEID of the node whose name is to be set.

  • bstrName
    Type: System.String

    [in] BSTR that contains the name to be set for the specified node.

Remarks

Security noteSecurity Note

The value of a DSRefDSREFNODEID_ROOT node name property, as set with the method, is conventionally a connection string. Such connection strings typically open a connection to a database and may have substrings containing a required password. This convention poses a security risk, because a DSRef object can be passed to an untrusted component. Therefore, never pass personal or proprietary information to the DSRef object in the connection string or substrings.

Conversely, DSRef consumer applications should not depend on the DSRef to provide user authentication information. For example, DSRefs provided by the server explorer should always be stripped of personal or proprietary information.

Examples

IDSRefProvider *pIDSRefProvider;
DSREFNODEID drnid;
BSTR dsrnName;
pIDSRefProvider->SetName(drnid, dsrnName);

.NET Framework Security

See Also

Reference

IDSRefProvider Interface

Microsoft.VisualStudio.Data.Interop Namespace

Other Resources

Data Designer Extensibility (DDEX) SDK