DataParameter.TryConvertValue Method
Attempts to convert the specified value to the specified type.
Namespace: Microsoft.VisualStudio.Data.Framework
Assembly: Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)
Syntax
'Declaration
Protected Overridable Function TryConvertValue ( _
value As Object, _
type As String _
) As Object
protected virtual Object TryConvertValue(
Object value,
string type
)
protected:
virtual Object^ TryConvertValue(
Object^ value,
String^ type
)
abstract TryConvertValue :
value:Object *
type:string -> Object
override TryConvertValue :
value:Object *
type:string -> Object
protected function TryConvertValue(
value : Object,
type : String
) : Object
Parameters
value
Type: System.ObjectA potential parameter value.
type
Type: System.StringThe name of a parameter type.
Return Value
Type: System.Object
The converted value, or nulla null reference (Nothing in Visual Basic) if no conversion is possible.
Remarks
This method is called by the base implementation of OnTypeChanged to attempt to convert any currently set parameter value to the new type. The method should handle any value input, including Value and nulla null reference (Nothing in Visual Basic).
In the case of DBNull, the method should simply return DBNull. In the case of null, it should return null.
The base implementation of this method handles the DBNull case and returns null for all other cases.
.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.