SqlParameter.LocaleId Property

Definition

Gets or sets the locale identifier that determines conventions and language for a particular region.

C#
[System.ComponentModel.Browsable(false)]
public int LocaleId { get; set; }
C#
public int LocaleId { get; set; }

Property Value

The locale identifier associated with the parameter.

Attributes

Remarks

The locale identifies conventions and language for a particular geographical region. The codepage used to encode a specific string (the character set) is based on the locale used by that string or the environment that produced it. This property sets (for input parameters) or gets (for output parameters) the locale to be attached to a string when exchanging data with the server. This property is typically used together with the CompareInfo property.

C#
static void CreateSqlParameterLocaleId(){  
   SqlParameter parameter = new SqlParameter("pName", SqlDbType.VarChar);  
   parameter.LocaleId = 1033;   // English - United States  
}  

Applies to

Product Versions
SqlClient .NET Core 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Framework 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2
SqlClient .NET Standard 1.0, 1.1, 2.0, 2.1, 3.0, 3.1, 4.0, 4.1, 5.0, 5.1, 5.2