QueryStringConverter.ConvertValueToString(Object, Type) Metodo

Definizione

Converte un parametro in una rappresentazione della stringa di query.

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

Parametri

parameter
Object

Parametro da convertire.

parameterType
Type

Oggetto Type del parametro da convertire.

Restituisce

String

Nome e valore del parametro.

Esempio

Nel codice seguente viene illustrato come convertire un valore tipizzato in una rappresentazione di stringa del valore.

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)

Si applica a