Compartir a través de


DataParameter.TryConvertValue (Método)

Intenta convertir el valor especificado al tipo especificado.

Espacio de nombres:  Microsoft.VisualStudio.Data
Ensamblado:  Microsoft.VisualStudio.Data (en Microsoft.VisualStudio.Data.dll)

Sintaxis

'Declaración
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

Parámetros

Valor devuelto

Tipo: System.Object
Devuelve el valor convertido, o devuelve nullreferencia null (Nothing en Visual Basic) si no hay conversión posible.

Comentarios

Este método llama la implementación base de OnTypeChanged para intentar convertir cualquier valor de parámetro actualmente establecido al nuevo tipo.El método debe controlar cualquier entrada de valor, incluidos Value y nullreferencia null (Nothing en Visual Basic).

En el caso de DBNull, el método debe devolver simplemente DBNull es el valor convertido.En el caso de nullreferencia null (Nothing en Visual Basic), debe devolver nullreferencia null (Nothing en Visual Basic).

La implementación base de este método controla el caso de DBNull y devuelve nullreferencia null (Nothing en Visual Basic) para todos los demás casos.

Seguridad de .NET Framework

Vea también

Referencia

DataParameter Clase

Microsoft.VisualStudio.Data (Espacio de nombres)