Share via


QueryStringConverter.ConvertValueToString(Object, Type) Método

Definición

Convierte un parámetro en una representación de cadena de consulta.

public:
 virtual System::String ^ ConvertValueToString(System::Object ^ parameter, Type ^ parameterType);
public virtual string ConvertValueToString (object parameter, Type parameterType);
abstract member ConvertValueToString : obj * Type -> string
override this.ConvertValueToString : obj * Type -> string
Public Overridable Function ConvertValueToString (parameter As Object, parameterType As Type) As String

Parámetros

parameter
Object

El parámetro que se va a convertir.

parameterType
Type

Type del parámetro que se va a convertir.

Devoluciones

String

El nombre y el valor del parámetro.

Ejemplos

El código siguiente muestra cómo convertir un valor con tipo en una representación de cadena del valor.

int value = 321;
string strValue = converter.ConvertValueToString(value, typeof(Int32));
Console.WriteLine("the value = {0}, the string representation of the value = {1}", value, strValue);
Dim value As Integer = 321
Dim strValue As String = converter.ConvertValueToString(value, GetType(Int32))
Console.WriteLine("the value = {0}, the string representation of the value = {1}", value, strValue)

Se aplica a