DataConnectionProperties.ReadValueFromString Method
Reads a property value from a connection string starting at a specified index, converts it to the correct type, and updates the index to point to a position following the property name.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'Declaration
Protected Overridable Function ReadValueFromString ( _
key As String, _
connectionString As String, _
ByRef index As Integer _
) As Object
protected virtual Object ReadValueFromString(
string key,
string connectionString,
ref int index
)
protected:
virtual Object^ ReadValueFromString(
String^ key,
String^ connectionString,
int% index
)
abstract ReadValueFromString :
key:string *
connectionString:string *
index:int byref -> Object
override ReadValueFromString :
key:string *
connectionString:string *
index:int byref -> Object
protected function ReadValueFromString(
key : String,
connectionString : String,
index : int
) : Object
Parameters
- key
Type: System.String
The name of the property key for which a value is being read.
- connectionString
Type: System.String
The connection string from which the value should be read.
- index
Type: System.Int32%
Index in the connection string from which to start reading the value.
Return Value
Type: System.Object
A substring of the connectionString parameter representing the property value between the input starting index and the end of the property name, converted to the correct type.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | The key and/or connectionString parameter is nulla null reference (Nothing in Visual Basic). |
OutOfRangeException | 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 the current location in the string and relies on this method and the ReadKeyFromString method to update the index appropriately.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.