Condividi tramite


Metodo SqlFunctions.StringConvert (Nullable<Decimal>, Nullable<Int32>)

[Questa pagina è specifica della versione 6 di Entity Framework. La versione più recente è disponibile come pacchetto NuGet per "Entity Framework". Per ulteriori informazioni su Entity Framework, vedere la pagina msdn.com/data/ef.]

Restituisce dati di tipo carattere convertiti da dati numerici.

Spazio dei nomi:  System.Data.Entity.SqlServer
Assembly:  EntityFramework.SqlServer (in EntityFramework.SqlServer.dll)

Sintassi

'Dichiarazione
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "number")> _
<DbFunctionAttribute("SqlServer", "STR")> _
<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId := "length")> _
Public Shared Function StringConvert ( _
    number As Nullable(Of Decimal), _
    length As Nullable(Of Integer) _
) As String
'Utilizzo
Dim number As Nullable(Of Decimal)
Dim length As Nullable(Of Integer)
Dim returnValue As String 

returnValue = SqlFunctions.StringConvert(number, _
    length)
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")]
[DbFunctionAttribute("SqlServer", "STR")]
[SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")]
public static string StringConvert(
    Nullable<decimal> number,
    Nullable<int> length
)
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"number")]
[DbFunctionAttribute(L"SqlServer", L"STR")]
[SuppressMessageAttribute(L"Microsoft.Usage", L"CA1801:ReviewUnusedParameters", MessageId = L"length")]
public:
static String^ StringConvert(
    Nullable<Decimal> number, 
    Nullable<int> length
)
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "number")>]
[<DbFunctionAttribute("SqlServer", "STR")>]
[<SuppressMessageAttribute("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "length")>]
static member StringConvert : 
        number:Nullable<decimal> * 
        length:Nullable<int> -> string
public static function StringConvert(
    number : Nullable<decimal>, 
    length : Nullable<int>
) : String

Parametri

  • length
    Tipo: System.Nullable<Int32>
    Lunghezza totale della stringa. Include il separatore decimale, il segno, le cifre e gli spazi. Il valore predefinito è 10.

Valore restituito

Tipo: System.String
Espressione di input convertita in una stringa.

Vedere anche

Riferimento

SqlFunctions Classe

Overload StringConvert

Spazio dei nomi System.Data.Entity.SqlServer