Compartilhar via


DataConnectionProperties.ReadKeyFromString Method

Reads a property key name from a connection string starting at a specified index, and then updates the index to point to a position immediately following the property key name.

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

Syntax

'Declaration
Protected Overridable Function ReadKeyFromString ( _
    connectionString As String, _
    ByRef index As Integer _
) As String
protected virtual string ReadKeyFromString(
    string connectionString,
    ref int index
)
protected:
virtual String^ ReadKeyFromString(
    String^ connectionString, 
    int% index
)
abstract ReadKeyFromString : 
        connectionString:string * 
        index:int byref -> string  
override ReadKeyFromString : 
        connectionString:string * 
        index:int byref -> string
protected function ReadKeyFromString(
    connectionString : String, 
    index : int
) : String

Parameters

  • index
    Type: System.Int32%

    An index in this connection string indicating where to start reading the property name.

Return Value

Type: System.String
The substring of the connectionString parameter that represents the property key name, between the input starting index and the end of the property key name.

Exceptions

Exception Condition
ArgumentNullException

The connectionString parameter is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

The index parameter is less than zero or greater than the length of the connection string.

Remarks

The base implementation of the Parse method calls this method while parsing the input connection string. It uses the index parameter to track of the current position in the string and relies on this method and the ReadValueFromString method to update the index appropriately.

The base implementation of this method reads until it encounters the first property name/value pair separator.

.NET Framework Security

See Also

Reference

DataConnectionProperties Class

Microsoft.VisualStudio.Data.Framework Namespace