Επεξεργασία

Κοινή χρήση μέσω


QueryStringConverter.ConvertValueToString(Object, Type) Method

Definition

Converts a parameter to a query string representation.

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

Parameters

parameter
Object

The parameter to convert.

parameterType
Type

The Type of the parameter to convert.

Returns

The parameter name and value.

Examples

The following code shows how to convert a typed value into a string representation of the value.

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)

Applies to